Harryxun/stf_run huggingface dataset:
from math import sqrt

def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while a % b > 0:
        a, b = b, a%b
    return b

def divisor(a):
    lim = int(sqrt(a))
    divset = set()
    for i in range(1, lim + 1):
        if a % i == 0:
            divset |= {i, a//i}
    return divset

def is_prime(a):
    lim = int(sqrt(a))
    for i in range(2, lim + 1):
        if a != i and a % i == 0: return False
    else: return True

N = int(input())
A = []
sum = 0
for n in range(N+1):
    a = abs(int(input()))
    if a > 0: 
        A.append(a)
        sum += a % 2
        sum %= 2
div_by_two = False
if sum  == 0: div_by_two = True

gcd_of_A = A[0]
for a in A[1:]:
    gcd_of_A = gcd(gcd_of_A, a)

sum = 0
if not div_by_two:
    for a in A: 
        sum += (a // gcd_of_A) % 2
        sum %= 2
if sum == 0: div_by_two = True

commondiv = divisor(gcd_of_A)
primes = []
for div in commondiv:
    if div > 1 and is_prime(div): primes.append(div)
primes.sort()
if primes[0] != 2 and div_by_two: print(2)
for p in primes: print(p)

### FIXED CODE ###

def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while a % b > 0:
        a, b = b, a%b
    return b

def divisor(a):
    i = 1
    divset = set()
    while i * i <= a:
        if a % i == 0: divset |= {i, a//i}
        i += 1
    divset.remove(1)
    return divset

def is_prime(a):
    if a <= 3: 
        prime = [False, False, True, True]
        return prime[a]
    i = 2
    while i * i <= a:
        if a % i == 0: return False
        i += 1
    else: return True

N = int(input())
A = [None] * (N+1)
for i in reversed(range(N+1)):
    A[i] = int(input())

primes_bool = [True] * (N + 1)
primes = []
for p in range(2, N+1):
    if primes_bool[p]:
        primes.append(p)
        p_mult = p * 2
        while p_mult <= N:
            primes_bool[p_mult] = False
            p_mult += p

ans = []
used = set()
gcd_of_A = abs(A[N])
for a in A[:N]:
    if a != 0: gcd_of_A = gcd(abs(a), gcd_of_A)

commondiv = divisor(gcd_of_A)
for d in commondiv:
    if d > 1 and is_prime(d): 
        ans.append(d)
        used |= {d}

for p in primes:
    if A[0] % p == 0:
        for i in range(1, p):
            coefficient = 0
            index_a = i
            while index_a <= N:
                coefficient += A[index_a]
                coefficient %= p
                index_a += p-1
            if coefficient > 0: break
        else:
            if p not in used: ans.append(p)

ans.sort()
for a in ans: print(a)
t = 0
while t == 0:	
	try:
		a,b,e,c,d,f = [int(i) for i in input().split()]
	except:
		break
	else:
		x = (d*e - b*f) / (a*d - b*c)
		y = (a*f - c*e) / (a*d - b*c)
		print(???{0:.3f}".format(x) + ??? ??? + ???{0:.3f}".format(y))

### FIXED CODE ###

t = 0
while t == 0:	
	try:
		a,b,e,c,d,f = [int(i) for i in input().split()]
	except:
		break
	else:
		x = (d*e - b*f) / (a*d - b*c) + 0
		y = (a*f - c*e) / (a*d - b*c) + 0
		print("{0:.3f}".format(x) + " " + "{0:.3f}".format(y))
cards = {
        'S': [0 for _ in range(13)],
        'H': [0 for _ in range(13)],
        'C': [0 for _ in range(13)],
        'D': [0 for _ in range(13)],
}
n = int(input())
for _ in range(n):
    (s, r) = input().split()
    cards[s][int(r) - 1] = 1
 
for s in ('S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print(s, r + 1)

### FIXED CODE ###

data = [[[0 for r in range(10)] for f in range(3)] for b in range(4)]
n = int(input())
for _ in range(n):
    (b, f, r, v) = [int(i) for i in input().split()]
    data[b - 1][f - 1][r - 1] += v
 
for b in range(4):
    for f in range(3):
        for r in range(10):
            print('', data[b][f][r], end='')
        print()
    if b != 3:
        print('#' * 20)
# Problem E - This Message Will Self-Destruct in 5s

# input
N = int(input())
a_nums = list(map(int, input().split()))

# initialization
tmp_1 = [0]*(10**6)
ans = 0

# count
for i in range(1, N+1):
    tmp_1[i + a_nums[i-1]] += 1

# count 2
for j in range(1, N+1):
    if j-a_nums[j-1]>=0:
        ans +=  tmp_1[j-a_nums[j-1]]

# output
print(ans)


### FIXED CODE ###

# Problem E - This Message Will Self-Destruct

# input
N = int(input())
a_nums = list(map(int, input().split()))

# initialization
num_dic = {}
ans = 0

# count
for i in range(1, N+1):
    a = a_nums[i-1] + i
    if not a in num_dic:
        num_dic[a] = 1
    else:
        num_dic[a] += 1

# count 2
for j in range(1, N+1):
    b = j - a_nums[j-1]
    if b in num_dic:
        ans += num_dic[b]

# output
print(ans)
a,b=map(int,input().split())
if a+b>=24:
    print(a+b-24):
else:
    print(a+b)

### FIXED CODE ###

a,b=map(int,input().split())
if a+b>=24:
    print(a+b-24)
else:
    print(a+b)
from decimal import Decimal
from math import floor

a_in, b_in= input().split()
a = int(a)
b = Decimal(b_in)

print(floor(a * b))

### FIXED CODE ###

from decimal import Decimal
from math import floor

a_in, b_in= input().split()
a = int(a_in)
b = Decimal(b_in)

print(floor(a * b))
h,n=map(int,input().split())
l=[]
for i in range(n):
  l.append(int(input()))
  
if sum(l)>=h:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

h, n = map(int, input().split())
a = list(map(int, input().split()))
at = sum(a)
 
if at >= h:
    print("Yes")
else:
    print("No")
import sys
input = sys.stdin.readline
n,k = map(int,input().split())
l = sorted([int(input()) for _ in range(n)])
print(min(l[i+k]-l[i] for i in range(n-k+1))) 

### FIXED CODE ###

import sys
input = sys.stdin.readline
n,k = map(int,input().split())
l = sorted([int(input()) for _ in range(n)])
print(min(l[i+k-1]-l[i] for i in range(n-k+1)))
l = sort(list(map(int,input().split())))
if l==[5,5,7]:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

A=input()
print(['NO','YES'][(A.count('5')==2)*(A.count('7')==1)])
n, m, c = map(int, input().split())
b = map(int, input().split())
counter = 0
for i in range(n):
  a = map(int, input().split())
  if sum([b[i]*a[i] for i in range(m)]) + c > 0:
    counter += 1
print(counter)

### FIXED CODE ###

n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
 
for i in range(n):
  a = list(map(int, input().split()))
  p = c
  for j in range(m):
  	p += a[j] * b[j]
  if 0 < p:
    count += 1
print(count)
import numpy as np
import math
n,x = map(int,input().split())
arr = list(map(int,input().split()))
arr = np.array(arr)
arr -= x
arr = np.abs(arr)
# print(arr)

ans = arr[0]
for i in range(1,n):
    ans = math.gcd(ans,arr[i])
print(ans)

### FIXED CODE ###

import numpy as np

def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)

def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g
n,x = map(int,input().split())
arr = list(map(int,input().split()))
arr = np.array(arr)
arr -= x
arr = np.abs(arr)
# print(arr)

if len(arr) == 1:
    print(arr[0])
else:
    print(gcd(arr))
def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    t = list(map(lambda x: x*(-1), t))
    heapq.heapify(t)
    while m > 0:
        v = heapq.heappop(t) * -1
        heapq.heappush(t, (v // 2)* -1)
        m -= 1

    print(sum(t)*-1)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import heapq
def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    t = list(map(lambda x: x*(-1), t))
    heapq.heapify(t)
    while m > 0:
        v = heapq.heappop(t) * -1
        heapq.heappush(t, (v // 2)* -1)
        m -= 1

    print(sum(t)*-1)


if __name__ == '__main__':
    main()
for i in range(1,10):
    for j in range(1, 10):
        print i + "x" + j + "=" + i*j

### FIXED CODE ###

for i in range(1, 10):
     for j in range(1,10):
         print str(i) + "x" + str(j) + "=" + str(i*j)
N = int(input())
ipts = [input() for i in range(N)]
dic = {}
for i in ipts:
    if(i not in dic):
        dic[i] =  True
print(len(dic))


### FIXED CODE ###

import re
ipt = input()
regText = r"(\d{4})/(\d{2})/(\d{2})"
repl = r"2018/\2/\3"
print(re.sub(regText,repl,ipt))
from collections import defaultdict
N = int(input())
bd = defaultdict(lambda: 0)
for i in range(N):
  bd[input()] += 1
N = int(input())
for i in range(N):
  bd[input()] -= 1

print(max([max(bd.values()), 0])

### FIXED CODE ###

from collections import defaultdict
N = int(input())
bd = defaultdict(lambda: 0)
for i in range(N):
  bd[input()] += 1
N = int(input())
for i in range(N):
  bd[input()] -= 1

print(max([max(bd.values()), 0]))
A, B = map(int,input().split())

import math 
a = [x for x in range(math.ceil(A*12.5),math.ceil((A+1)*12.5))]
b = [x for x in range(math.ceil(B*10),math.ceil((B+1)*10))]

c = set(a) & set(b)

if c != {}:
  print(min(c))
else:
  print(-1)

### FIXED CODE ###

A, B = map(int,input().split())

import math 
a = [x for x in range(math.ceil(A*12.5),math.ceil((A+1)*12.5))]
b = [x for x in range(math.ceil(B*10),math.ceil((B+1)*10))]

c = set(a) & set(b)

if c != set():
  print(min(c))
else:
  print(-1)
n=int(input())
var=1
if n%360==0:
	print(0)
    exit()
while True:
	if (n*var)%360==0:
		print(var)
        exit()
   var+=1

### FIXED CODE ###

# for i in range(m):
# for i in range(int(input())):
#n,k= map(int, input().split())
#for _ in range(int(input())):
    #n,k= map(int, input().split())
#from collections import Counter
n=int(input())
if n%360==0:
    print(0)
    exit()
else:
    var=1
    while (var*n)%360!=0:
        var+=1
    print(var)
x,y = map(str,input().split())
z = x+y
Z=int(z)
for i in range(100):
  if i**2 = Z:
    ans = "Yes"
  else:
    ans = "No"
print(ans)

### FIXED CODE ###

a,b=map(int,input().split())
c=int(str(a)+str(b))
for i in range(int(c**(1/2))+1) :
  if i**2==c :
    print("Yes")
    exit()
print("No")
import numpy as np

s = np.array(input().split()).astype(int)
# =============================================================================
# if s.find("A") >= 0 and s.find("B") >= 0:
#     print("Yes")
# else:
#     print("No")
# =============================================================================

# =============================================================================
# N,A,B = s
# 
# print(N//(A+B)*A + np.array([N%(A+B),A]).min())
# =============================================================================

A,B = s

eight =  100/8
ten = 100/10
x1 = A*eight
x2 = A*ten
ans = []
ans2 = []
if x1 == x2:
    ans.append(x1)
else:
    for i in range(np.array([x1,x2]).min().astype(int),np.array([x1,x2]).max().astype(int)+1):
        if int(i * 1/eight) == A and int(i * 1/ten) == B:
            ans.append(i)
        ans2.append(i)
if (int)(A * 10/8) != B:
    print(-1)
else:
    print(np.array(ans).min().astype(int))


### FIXED CODE ###

import numpy as np

s = np.array(input().split()).astype(int)
# =============================================================================
# if s.find("A") >= 0 and s.find("B") >= 0:
#     print("Yes")
# else:
#     print("No")
# =============================================================================

# =============================================================================
# N,A,B = s
# 
# print(N//(A+B)*A + np.array([N%(A+B),A]).min())
# =============================================================================

A,B = s

eight =  100/8
ten = 100/10
x1 = A*eight
x2 = A*ten
ans = []

for i in np.arange(0,np.array([x1,x2]).max().astype(int) + 100):
    if int(i * 1/eight) == A and int(i * 1/ten) == B:
        ans.append(i)
if len(ans) == 0:
    print(-1)
else:
    print(np.array(ans).min().astype(int))
S=list(input())
K="Yes"
for i in range (0,len(S)):
	if i%2==0:
		if S[i]=="L" :
        	K="No"
			break
		else:
        	continue
	else :
		if S[i]=="R" :
			K="No"
			break
		else:
			continue
print(K)

### FIXED CODE ###

S=input()
if S[0]=="R":
    print("Sunny")
elif S[0]=="S":
    print("Cloudy")
else:
    print("Rainy")
n=int(intput())
print(int((n**2-n)//2))

### FIXED CODE ###

n=int(input())
print((n**2-n)//2)
a= int(input())
b = int(input())
c=int(input())
d = int(input())
pritn(min(a,b)*min(c,d))

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(min(a,b)+min(c,d))
import math
print(int(input())**2*math.pi)


### FIXED CODE ###

import math
r,p = float(input()),math.pi
print(r**2*p,2*p*r)
n = int(input())

#[～][0] =>t [1]=>x [2]=>y
l = [list(map(int,input().split())) for i in range(n)]

judge = 'No'

#初期値
l.insert(0,[0,0,0])
for i in range(n):
    #奇数がT偶数がF
    n_j = (l[i+1][0]-l[i][0])%2==1
    xy = (l[i+1][1]+l[i+1][2])-(l[i][1]+l[i][2])
    if n_j==xy%2 & n_j>=abs(xy):
        judge = 'Yes'
    else:
        judge ='No'
        break

print(judge)

### FIXED CODE ###


a,b = map(int,input().split())

c = a*b

if c%2==1:
    print("Odd")
else:
    print("Even")
H, W, K = map(int, input().split())
C = []
for i in range(H):
    c = str(input())
    C.append(c)
from itertools import combinations
from collections import Counter

def subsets(nums):
    n = len(nums)
    out = []
    for i in range(n+1):
        subout = []
        comb(nums, i, subout)
        out += subout
    return out

def comb(seq, k, out):
    _comb(seq, len(seq), k, 0, [], out)

def _comb(seq, n, k, i, elem, out):
    le = len(elem)
    if le == k:
        out.append(elem)
        return
    for i in range(i, n):
        _comb(seq, n, k, i+1, elem + [seq[i]], out)

def powset(H, W, K, C):
    X = subsets(list(range(W)))
    N = len(X)
    A = []
    for j in range(H):
        a = [0]*N
        for k in range(N):
            for ind in X[k]:
                if C[j][ind] == '#':
                    a[k] += 1
        A.append(a)
    Y = subsets(list(range(H)))
    M = len(Y)
    ans = [0]*(N*M)
    for k in range(N):
        for l in range(M):
            for ind in Y[l]:
                ans[l*M+k] += A[ind][k]
            
    c = Counter(ans)
#     print(c)
    if K in c:
        return c[K]
    else:
        return 0
        

def Main(H, W, K, C):
    return powset(H, W, K, C)
                    
out = Main(H, W, K, C)
print(out)

### FIXED CODE ###

H, W, K = map(int, input().split())
C = []
for i in range(H):
    c = str(input())
    C.append(c)
from itertools import combinations
from collections import Counter

def subsets(nums):
    n = len(nums)
    out = []
    for i in range(n+1):
        subout = []
        comb(nums, i, subout)
        out += subout
    return out

def comb(seq, k, out):
    _comb(seq, len(seq), k, 0, [], out)

def _comb(seq, n, k, i, elem, out):
    le = len(elem)
    if le == k:
        out.append(elem)
        return
    for i in range(i, n):
        _comb(seq, n, k, i+1, elem + [seq[i]], out)

def powset(H, W, K, C):
    X = subsets(list(range(W)))
    N = len(X)
    A = []
    for j in range(H):
        a = [0]*N
        for k in range(N):
            for ind in X[k]:
                if C[j][ind] == '#':
                    a[k] += 1
        A.append(a)
    Y = subsets(list(range(H)))
    M = len(Y)
    ans = [0]*(N*M)
    for k in range(N):
        for l in range(M):
            for ind in Y[l]:
                ans[l*N+k] += A[ind][k]
            
    c = Counter(ans)
#     print(c)
    if K in c:
        return c[K]
    else:
        return 0
        

def Main(H, W, K, C):
    return powset(H, W, K, C)
                    
out = Main(H, W, K, C)
print(out)
N = int(input())
if N % 2 == 1:
	print(0)
else:
	ans = 0
	if N <= 9:
		pass
	else:
		ans += N//10
		N = int(N/10)
		while N >= 5:
			ans += N//5
			N = int(N/5)
print(ans)

### FIXED CODE ###

from decimal import getcontext, Decimal
getcontext().prec = 1

N = int(input())
if N % 2 == 1:
	print(0)
else:
	ans = 0
	if N <= 9:
		pass
	else:
		ans += N//10
		N //= 10
		while N >= 5:
			ans += N//5
			N //= 5
	print(ans)
n,m=list(map(int,input().split()))
a = [int(input()) for _ in range(m)]

pre2 = 0
pre1 = 0
cur = 1
a_id = 0

for i in range(n):
    pre2 = pre1
    pre1 = cur 
    cur = pre1 + pre2
    if i+1 == a[a_id]:
        a_id += 1 if a_id < m-1 else 0
        cur = 0
    if cur == 0 and pre1 == 0:
        break
print(cur%1000000007)

### FIXED CODE ###

n,m=list(map(int,input().split()))

if n+1 < 2*m:
    print(0)
else:
    a = [int(input()) for _ in range(m)]

    pre2 = 0
    pre1 = 0
    cur = 1
    a_id = 0

    for i in range(n):
        pre2 = pre1
        pre1 = cur 
        cur = pre1 + pre2
        if a_id < m:
            if i+1 == a[a_id]:
                a_id += 1 if a_id < m-1 else 0
                cur = 0
        if cur == 0 and pre1 == 0:
            break
    print(cur%1000000007)
N, K = map(int, input().split())
gap = abs(N - K)

if K == 1:
    print(0)
else:
    ans = N % gap
    print(ans)

### FIXED CODE ###

N, K = map(int, input().split())

# print(N % K)
# print(N % abs(N-K))

# SN = N
# PN = float('inf')
# while PN > N:
#     PN = N
#     N = abs(N-K)
#     print(PN, N)

if N == K:
    print(0)

elif N > K:
    val = N % K
    print(min(abs(val), abs(val-K)))
else:
    SN = N
    PN = float('inf')
    while PN > N:
        PN = N
        N = abs(N-K)
    print(min(SN, PN))
N = int(input())
a_list = []
b_list = []

for i in range(N):
    a, b = map(int, input().split())
    a_list.append(a)
    b_list.append(b)

count = 0
for i in range(N-1, -1, -1):
    a = a_list[i]
    b = b_list[i]
    if b == 1:
        continue

    if b % a == 0:
        continue

    if count > 0:
        a += count

    margin = b - (a % b)
    count += margin
print(count)

### FIXED CODE ###

N = int(input())
a_list = []
b_list = []

for i in range(N):
    a, b = map(int, input().split())
    a_list.append(a)
    b_list.append(b)

count = 0
for i in range(N-1, -1, -1):
    a = a_list[i]
    b = b_list[i]
    if a == 0:
        continue
    if b == 1:
        continue

    if count > 0:
        a += count
    if a % b == 0:
        continue

    margin = b - (a % b)
    count += margin
print(count)
dp=["","+"]
s=input()
su=0
for i in range(2**(len(s)-1)):
    val=""
    for j in range(len(s)-1):
        val+=s[j]+dp[bin(i)[j+2]]
    val+=s[len(s)-1]
    su+=eval(val)
print(su)

### FIXED CODE ###

dp=["","+"]
s=input()
su=0
for i in range(2**(len(s)-1)):
    val=""
    b=bin(i)[2:].zfill(len(s)-1)
    for j in range(len(s)-1):
        val+=s[j]+dp[int(b[j])]
    val+=s[len(s)-1]
    su+=eval(val)
print(su)
a,b,x = map(int, inpu().split())
na = (a-1) // x + 1
nb = b // x + 1
print(nb-na)

### FIXED CODE ###

a,b,x = map(int, input().split())
na = (a-1) // x + 1
nb = b // x + 1
print(nb-na)
import sys
num = sys.stdin.readline()
ans = num*num*num
print ans

### FIXED CODE ###

num=raw_input()
num = int(num)
ans = num*num*num
print ans
N = int(input())
S = input()
ans = "Yes"
if N % 2 != 0:
    ans = "No"
else:
    N = int(N/2)
    for i in range(0, N):
        if S[i] != S[i+3]:
            ans = "No"
            break
print(ans)


### FIXED CODE ###

N = int(input())
S = input()
ans = "Yes"
if N % 2 != 0:
    ans = "No"
else:
    N = int(N/2)
    for i in range(0, N):
        if S[i] != S[i+N]:
            ans = "No"
            break
print(ans)
S=list(int(i) for i in input().split())
for x in range(len(S)+1):
  if S[x]==S[x+1]:
    print('Bad')
  break 
else:
  print('Good')


### FIXED CODE ###

S=list(int(i) for i in input())
for i in range(len(S)-1):
  if S[i]==S[i+1]:
    print('Bad')
    break
else:
  print('Good')
N,K= map(int,input().split())
import math
import itertools

f = 1
if math.factorial(N-1) < K:
    f = 0

if f == 0:
    print(-1)

if f!=0:
    ans_list = []
    kumi = list(itertools.permutations(range(2,N+1), 2))
    # ans_list.append(kumi)
    for i in range(2,N+1):
        ans_list.append((1,i))
    for i in range(0,K):
        ans_list.append(kumi[i])
    
    print(len(ans_list))
    for i in range(len(ans_list)):
        print(ans_list[i][0],ans_list[i][1])

### FIXED CODE ###

N,K= map(int,input().split())
import math
import itertools

f = 1

if len(list(itertools.combinations(range(1,N),2))) < K:
    f = 0

if f == 0:
    print(-1)

if f!=0:
    ans_list = []
    kumi = list(itertools.combinations(range(2,N+1), 2))
    kumilen = len(kumi)
    # ans_list.append(kumi)
    for i in range(2,N+1):
        ans_list.append((1,i))
    for i in range(0,kumilen-K):
        ans_list.append(kumi[i])
    
    print(len(ans_list))
    for i in range(len(ans_list)):
        print(ans_list[i][0],ans_list[i][1])
n,m=map(int,input().split())
d=[list(map(int,input().split())) for _ in range(m)]
c=[list(map(int,input().split())) for _ in range(n)]
ans0=[0]
ans1=[0]
ans2=[0]
for k in range(1,m+1):
    a0=0
    a1=0
    a2=0
    for i in range(n):
        for j in range(n):
            if (i+j+2)%3==0:
                a0+=d[c[i][j]-1][k-1]
            elif (i+j+2)%3==1:
                a1+=d[c[i][j]-1][k-1]
            else:
                a2+=d[c[i][j]-1][k-1]
    ans0.append(a0)
    ans1.append(a1)
    ans2.append(a2)
ans=float("inf")
import itertools
for x,y,z in itertools.permutations(range(1,m+1)):
    ans=min(ans,ans0[x]+ans1[y]+ans2[z])

print(ans)


### FIXED CODE ###

n,m=map(int,input().split())
d=[list(map(int,input().split())) for _ in range(m)]
c=[list(map(int,input().split())) for _ in range(n)]
ans0=[0]
ans1=[0]
ans2=[0]
for k in range(1,m+1):
    a0=0
    a1=0
    a2=0
    for i in range(n):
        for j in range(n):
            if (i+j+2)%3==0:
                a0+=d[c[i][j]-1][k-1]
            elif (i+j+2)%3==1:
                a1+=d[c[i][j]-1][k-1]
            else:
                a2+=d[c[i][j]-1][k-1]
    ans0.append(a0)
    ans1.append(a1)
    ans2.append(a2)
ans=float("inf")
import itertools
for x,y,z in itertools.permutations(range(1,m+1),3):
    ans=min(ans,ans0[x]+ans1[y]+ans2[z])

print(ans)
n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]
x=[]
y=[]
for i in lst:
  if lst[0]==1:
    x+=[lst[1]]
for i in lst:
  if lst[1]==n:
    y+=[lst[0]]
ans='IMPOSSIBLE'
for i in x:
  if i in y:
    ans='POSSIBLE'
    break
print(ans)

### FIXED CODE ###

n,m=map(int,input().split())
lst=[list(map(int,input().split())) for i in range(m)]

x=[]
y=[]

for i in lst:
  if i[0]==1:
    x+=[i[1]]
    
for i in lst:
  if i[1]==n:
    y+=[i[0]]
    
ans='POSSIBLE'

if len(list(set(x)))+len(list(set(y)))==len(list(set(x+y))):
  ans='IMPOSSIBLE'
    
print(ans)
n = int(input())
nums = list(map(int, input().split()))
if n == 0:
  if nums[0] == 1:
    print(1)
  else:
    print(-1)
  exit()
if n >=1 and nums[0] != 0:
  print(-1)
  exit()
n_nods = 1
ans = 1
ret = sum(nums)
for i in range(1,n+1):
  n_nods = min(n_nods*2,ret)
  ans += n_nods
  ret -= nums[i]
  n_nods -= nums[i]
  if n_nods < 0:
    print(-1)
    exxit()
  if n_nods == 0 and i < n:
    print(-1)
    exit()
print(ans)

### FIXED CODE ###

n = int(input())
nums = list(map(int, input().split()))
if n == 0:
  if nums[0] == 1:
    print(1)
  else:
    print(-1)
  exit()
if n > 0 and nums[0] != 0:
  print(-1)
  exit()
n_nods = 1
ans = 1
ret = sum(nums)
for i in range(1,n+1):
  n_nods = min(n_nods*2,ret)
  ans += n_nods
  ret -= nums[i]
  n_nods -= nums[i]
  if n_nods < 0:
    print(-1)
    exit()
  if n_nods == 0 and i < n:
    print(-1)
    exit()
print(ans)
n, m = map(int, input().split())
a = [int(input()) for i in range(m)]

f = [0] * (n + 1)

f[0] = 1

if a[0] == 1:
    f[1] = 0
else:
    f[1] = 1

for i in range(2, n + 1):
    if i in a:
        f[i] = 0
    else:
        f[i] = f[i - 1] + f[i - 2]

print(f[n] % 1000000007)


### FIXED CODE ###

def main():
    N, M, *a = map(int, open(0).read().split())
    div = 1000000007
    broken = set(a)
 
    comb_list = [0] * (N + 1)
    comb_list[0] = 1
    if 1 not in broken:
        comb_list[1] = 1
 
    for i in range(2, N + 1):
        if i in broken:
            continue
        comb_list[i] = (comb_list[i - 1] + comb_list[i - 2]) % div
 
    print(comb_list[-1])
 
 
if __name__ == "__main__":
    main()