Harryxun/stf_run huggingface dataset:
N, M, C = map(int, input().split())
B=list(map(int, input().split()))
answer=0
sum=0  
for i in range(N):
  A=list(map(int, input().split))
  for j in range(M):
    sum+=B[j]*A[j]
  if (sum+C)>0:
    answer+=1
print(answer)

### 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 p>0:count+=1
print(count)
N, M, X = map(int, raw_input().split(" "))
A = map(int, raw_input().split(" "))
left, right = 0,0
for ai in A:
  if ai < X: left+=1
  else: right+=1
print(min(right, left))


### FIXED CODE ###

N, M, X = map(int, input().split(" "))
A = map(int, input().split(" "))
left, right = 0,0
for ai in A:
  if ai < X: left+=1
  else: right+=1
print(min(right, left))
inr = lambda: list(map(int, input().split()))

N, Y = inr()

lmn = [[-1, -1, -1]]

for x in range(N+1):
    Y_rem = Y - x * 10000
    N_rem = N - x
    if Y_rem >= 0:
        for y in range(N_rem+1):
            Y_rem = Y - x * 10000 - y * 5000
            N_rem = N - x - y
            z     = N_rem
            if Y_rem == z *1000:
                lmn.append([x, y, z])
print(lmn[1][0],lmn[1][1],lmn[1][2])

### FIXED CODE ###

inr = lambda: list(map(int, input().split()))

N, Y = inr()

lmn = [-1, -1, -1]

for x in range(N+1):
    for y in range(N-x+1):
        z = N - x - y
        oto_sum = 10000 * x + 5000 * y + 1000 * z
        if z >= 0 and oto_sum == Y:
            print(x, y, z)
            exit()

print(-1, -1, -1)
import math
N=input()
a=math.ceil(N/1.08)
if math.floor(a*1.08) == N:
  print(a)
else:
  print(":(")

### FIXED CODE ###

import math
N=int(input())
a=math.ceil(N/1.08)
if math.floor(a*1.08) == N:
  print(a)
else:
  print(":(")
from networkx import *
h,w=map(int,input().split());r=range(10);G=DiGraph();G.add_nodes_from(r);C=[[*map(int,input().split())]for _ in "_"*10];G.add_weighted_edges_from([(i,j,C[i][j])for i in r for j in r]);S=[single_source_dijkstra_path_length(G,i)[1]for i in r];A=[[*map(int,input().split())]for _ in r];print(sum(S[abs(x)] for a in A for x in a))

### FIXED CODE ###

from networkx import *
h,w=map(int,input().split())
G=DiGraph()
G.add_nodes_from(range(10))
C=[[*map(int,input().split())]for _ in "_"*10]
G.add_weighted_edges_from([(i,j,C[i][j])for i in range(10)for j in range(10)])
S=[single_source_dijkstra_path_length(G,i)[1]for i in range(10)]
A=[[*map(int,input().split())]for _ in "_"*h]
print(sum(S[abs(x)] for a in A for x in a))
from math import gcd


N = int(input())
A = list(map(int, input().split()))

# setwise validation
tmp = 0
for a in A:
    tmp = gcd(tmp, a)
isSetwise = (tmp == 1)


# pairwise validation
M = 10 ** 6
A = set(A)
isPairwise = True
for i in range(2, M):
    cnt = 0
    ni = 0
    while (ni := ni + i) <= M:
        cnt += (ni in A)
    isPairwise &= (cnt <= 1)

# check
if isPairwise:
    ans = 'pairwise coprime'
elif isSetwise:
    ans = 'setwise coprime'
else:
    ans = 'not coprime'
print(ans)


### FIXED CODE ###

from math import gcd


# def sieve(n):
#     is_prime = [1 for _ in range(n + 1)]
#     is_prime[0] = 0
#     is_prime[1] = 0

#     for i in range(2, n + 1):
#         if is_prime[i]:
#             j = i + i
#             while j <= n:
#                 is_prime[j] = 0
#                 j += i

#     return is_prime


def factorization(n):
    from collections import Counter
    arr = Counter()
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr[i] = cnt

    if temp != 1:
        arr[temp] = 1

    if len(arr.keys()) == 0 and n != 1:
        arr[n] = 1

    return arr


N = int(input())
A = list(map(int, input().split()))

# setwise
tmp = 0
for a in A:
    tmp = gcd(tmp, a)
isSetwise = (tmp == 1)


# pairwise
M = 10 ** 6
sieve = [0] * (M + 1)
for a in A:
    if sieve[a] == 1:
        isPairwise = False
        break
    else:
        arr = factorization(a)
        for p in arr.keys():
            np = p
            while np <= M:
                sieve[np] = 1
                np += p
else:
    isPairwise = True

# check
if isPairwise:
    ans = 'pairwise coprime'
elif isSetwise:
    ans = 'setwise coprime'
else:
    ans = 'not coprime'
print(ans)
a, b, c = [int(i) for i in input().split(" ")]
if a == b and b == c
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a, b, c = [int(i) for i in input().split(" ")]
if a == b and b == c:
    print("Yes")
else:
    print("No")
N, M, X = map(int,input().split())

CAM = list([list(map(int,input().split())) for i in range(N)])
# print(CAM)
minn = 10**6
b = False

for i in range(2 ** N):
    bag = []
    for j in range(N):  # このループが一番のポイント
        if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
            bag.append(CAM[j])  # フラグが立っていたら bag に果物を詰める

    s = 0
    x=0
    y=0
    z=0
    for ij in range(len(bag)):
      s += bag[ij][0]
      x += bag[ij][1]
      y += bag[ij][2]
      z += bag[ij][3]

    if x >= X and y >= X and z >= X:
      minn = min(s,minn)
      b = True

print(minn if b == True else -1)

### FIXED CODE ###

N, M, X = map(int,input().split())

CAM = list([list(map(int,input().split())) for i in range(N)])
# print(CAM)
minn = 10**18
b = False

for i in range(2 ** N):
  s = 0
  am = []

  for j in range(N):  # このループが一番のポイント
      if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
        am.append(CAM[j])

  j = False
  sss = [0] * (M+1)
  for kk in range(len(am)):
    s += am[kk][0]
    for m in range(0, M):
      sss[m+1] += am[kk][m+1]
  
  if len([i for i in sss[1:] if i >= X] ) == len(sss[1:]):
    b = True
    minn = min(s,minn)
  
  # print(sss)
  # if x >= X and y >= X and z >= X:
  #   minn = min(s,minn)
  #   b = True

print(minn if b == True else -1)
# スペース区切りの整数の入力
h, w = map(int, input().split())


#　2次元行列のリストを作る。
list1 = [[0 for i in range(h)] for j in range(w)]
print(list1)

#list1[1][2] = 1
#list1[0][0] = "#"
#list1[1][1] = "."

#print(list1)
#print(list1[-1][-1])
#print(list1[0][0])

#list1[0:] = [int(input()) for i in range(h)]

#print(list1)

s = [0] * w

i = 0
for i in range(0,w):
	s[i] = input()

print(s)

print(list1)
print(list(s[0]))

list1[:][0] = list(s[0])
list1[:][1] = list(s[1])
list1[:][2] = list(s[2])

print(list1)



#list = [[int(i) for i in input().split()] for i in range(h)]

#print(list)


### FIXED CODE ###

#テストファイルで実行する時
import sys
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

def mine(s,i,j):
	
	ans = 0
	t = s[i-1][j-1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i-1][j]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i-1][j+1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i][j-1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i][j+1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i+1][j-1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i+1][j]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1

	t = s[i+1][j+1]
	if t == '*' or t == '.':
		ans = ans + 0
	else:
		ans = ans + 1	

	return ans


h,w = map(int,input().split())
s = [str('*'+input())+'*' for i in range(h)]

test = ''
for i in range(w+2):
	test = test + '*' 

#リストsの頭にtestを追加
s.insert( 0,test)

#リストsの最後にtestを追加
s.insert(len(s),test)

#h行w列の2次元リストの初期化
s2 = [[0] * w for i in range(h)]
						
for i in range(1,h+1):
	for j in range(1,w+1):
		if s[i][j]=='*':
			pass
		elif s[i][j]=='#' :
			s2[i-1][j-1]='#'
		else:
			s2[i-1][j-1] = str(mine(s,i,j))

for i in range(h):
	print(''.join(s2[i]))
a,b = [int(x) for x in input().split()]

answer = B
if 6 <= A <= 12:
  answer = B//2
elif A <= 5:
  answer = 0
  
print(answer)

### FIXED CODE ###

A,B = map(int,input().split())
 
answer = B
if 6 <= A <= 12:
  answer = B//2
elif A <= 5:
  answer = 0
  
print(answer)
#abc093b
import sys

a,b,k=map(int,raw_input().split())
if a==b:
 print a
 sys.exit()
l1=[i for i in xrange(a,a+k)]
l2=[i for i in xrange( b-k+1,b+1)]
s1=set(l1);print s1
s2=set(l2);print s2
if b-k>=k-a:
 res=list(s1 | s2)
else:
 res=list(s1 & s2)
res.sort()
for i in xrange(len(res)):
 print res[i]


### FIXED CODE ###

#abc093a

s=raw_input()
if s.count('a')==1 and s.count('b')==1 and s.count('c')==1:
 print 'Yes'
else:
 print 'No'
def dp_func(n,dp,h):
    dp[0]=0
    dp[1]=abs(h[1]-h[0])

    if n==0:
        return 0
    elif n==1:
        return dp[1]
    
    else:
        if dp[n-1]==-1:
            dp[n-1]=dp_func(n-1,dp,h)

        c1=dp[n-1]+abs(h[n]-h[n-1])

        if dp[n-2]==-1:
            dp[n-2]=dp_func(n-2,dp,h)
            
        c2=dp[n-2]+abs(h[n]-h[n-2])
        return min(c1,c2)

def main():
    #input
    N=int(input())
    h=list(map(int,input().strip().split()))

    dp=[-1 for n in range(N)]

    return dp_func(N-1,dp,h)

if __name__=="__main__":
    print(main())


### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)

def dp_func(n,dp,h):
    if n==0:
        return 0
    elif n==1:
        return dp[1]
    
    else:
        if dp[n-1]==-1:
            dp[n-1]=dp_func(n-1,dp,h)

        c1=dp[n-1]+abs(h[n]-h[n-1])

        if dp[n-2]==-1:
            dp[n-2]=dp_func(n-2,dp,h)
            
        c2=dp[n-2]+abs(h[n]-h[n-2])
        
        dp[n]=min(c1,c2)
        return dp[n]

def main():
    #input
    N=int(input())
    h=list(map(int,input().strip().split()))
    # N=10000
    # h=[n**2 for n in range(N)]

    dp=[-1 for n in range(N)]
    dp[0]=0
    dp[1]=abs(h[1]-h[0])

    return dp_func(N-1,dp,h)

if __name__=="__main__":
    print(main())
# -*- coding: utf-8 -*-
import copy

N = int(input())
A = list(map(int, input().split()))


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


def calc_gcd(arr):
    if len(arr) <= 0:
        return 0
    arr2 = copy.copy(arr)
    return gcd(calc_gcd(arr2[:len(arr)-1]), arr[-1])


ans = 1

B = copy.copy(A)

gcd_array = []
for i in range(N):
    B.pop(i)
    gcd_array.append(calc_gcd(B))
    B = copy.copy(A)

print(max(gcd_array))

### FIXED CODE ###

# -*- coding: utf-8 -*-
import fractions

N = int(input())
A = list(map(int, input().split()))


gcd = fractions.gcd


left = [0] * N
right = [0] * N
for i in range(N):
    if i == 0:
        left[0] = A[0]
        right[N-1] = A[-1]
        continue

    left[i] = gcd(left[i-1], A[i])
    right[N-i-1] = gcd(right[N-i], A[N-i-1])

max_gcd = right[1]
for i in range(N):
    if i == 0:
        continue
    elif i == N - 1:
        if max_gcd < left[-2]:
            max_gcd = left[-2]
    else:
        target = gcd(left[i-1], right[i+1])
        if max_gcd < target:
            max_gcd = target

print(max_gcd)
kp = list(map(int, input().rsplit()))
A = list(map(int, input().rsplit()))
max_range = kp[0]-A[-1]+A[0]
for idx in range(len(A)):
  dif = A[idx+1]-A[idx] 
  if dif >max_range:
    max_range = dif

print(kp[0] - max_range)
  

### FIXED CODE ###

kp = list(map(int, input().rsplit()))
A = list(map(int, input().rsplit()))
max_range = kp[0]-A[-1]+A[0]
for idx in range(len(A)-1):
  dif = A[idx+1]-A[idx] 
  if dif >max_range:
    max_range = dif
 
print(kp[0] - max_range)
#!/usr/bin/python3
import math

# main
n, q = map(int, input().split())
b_size = math.ceil(math.sqrt(n))
b_len = math.ceil(n/b_size)
a = [2 ** 31 - 1 for i in range(n)]
b = [min(a[b_size * i:b_size * (i + 1)]) for i in range(b_len)]
for i in range(q):
    com, x, y = map(int, input().split())
    if com == 0:
        # update
        a[x] = y
        # update b
        index = x // b_size
        if b[index] > y:
            b[index] = y
    else:
        # find
        target = []
        x_index = x // b_size
        y_index = y // b_size
        x_mod = x % b_size
        y_mod = y % b_size
        if x_index == y_index:
            target.extend(a[x:y + 1])
        else:
            if x_mod == 0:
                target.append(b[x_index])
            else:
                target.extend(a[x:(x_index + 1) * b_size])

            if y_mod == 3:
                target.append(b[y_index])
            else:
                target.extend(a[y_index * b_size:y + 1])

            if x_index + 1 <= y_index - 1:
                target.append(min(b[x_index + 1 : y_index - 1]))
        print(min(target))

### FIXED CODE ###

#!/usr/bin/python3
import math

# main
n, q = map(int, input().split())
b_size = math.ceil(math.sqrt(n))
b_len = math.ceil(n/b_size)
a = [2 ** 31 - 1 for i in range(n)]
b = [min(a[b_size * i:b_size * (i + 1)]) for i in range(b_len)]
for i in range(q):
    com, x, y = map(int, input().split())
    if com == 0:
        # update
        a[x] = y
        # update b
        index = x // b_size
        b[index] = min(a[index * b_size:(index + 1) * b_size])

    else:
        # find
        target = []
        x_index = x // b_size
        y_index = y // b_size
        x_mod = x % b_size
        y_mod = y % b_size
        if x_index == y_index:
            target.extend(a[x:y + 1])
        else:
            if x_mod == 0:
                target.append(b[x_index])
            else:
                target.extend(a[x:(x_index + 1) * b_size])

            if y_mod == b_size - 1:
                target.append(b[y_index])
            else:
                target.extend(a[y_index * b_size:y + 1])

            if x_index + 1 <= y_index - 1:
                target.append(min(b[x_index + 1 : y_index]))
        print(min(target))
N,M = map(int, input().strip())
G = [[] for _ in range(N)]
for _ in range(M):
  a,b = map(int, input().strip().split(' '))
  a,b = a-1, b-1
  G[a].append(b)
  G[b].append(a)

for i in range(N):
  print(len(G[i]))




### FIXED CODE ###

N,M = map(int, input().strip().split(' '))
G = [[] for _ in range(N)]
for _ in range(M):
  a,b = map(int, input().strip().split(' '))
  a,b = a-1, b-1
  G[a].append(b)
  G[b].append(a)

for i in range(N):
  print(len(G[i]))
a,b=map(int,input().split())
if a - b == 0 or 1 or -1:
    print(a + b)
else:
    if a > b:
        print(a + a -1)
    else:
        print(b + b -1

### FIXED CODE ###

a,b=map(int,input().split())
if abs(a - b) <= 1:
    print(a + b)
else:
    if a > b:
        print(a + a -1)
    else:
        print(b + b -1)
N = int(input())
A = list(map(int, input().split()))
def count(n, a):
    c = 0
    for i in range(n+1):
        if a[i] == n:
            c += 1
    return c
for j in range(N):
    print(count(j+1, A))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
buka = list()
for i in range(N):
    buka.append(0)
for j in range(len(A)):
    buka[A[j]-1] += 1
for k in range(len(buka)):
    print(buka[k])
n, k = map(int, input().split())

l = list(map(int, input().split()))
l = [(i+1)/2 for i in l]

ls = [l[0]]
for i in range(1, n):
    ls.append(ls[-1]+l[i])

lans = [ls[i+k]-ls[i] for i in range(len(ls)-k)]
print(max(lans))

### FIXED CODE ###

n, k = map(int, input().split())

l = list(map(int, input().split()))
l = [(i+1)/2 for i in l]

ls = [0, l[0]]
for i in range(1, n):
    ls.append(ls[-1]+l[i])

if n == 1:
    print(l[0])
else:
    lans = [ls[i+k]-ls[i] for i in range(len(ls)-k)]
    print(max(lans))
n=int(input())
d = list(map(int, input().split()))
a=0
for i in d:
  if d[i]=d[-1]:
    break
  for j in d[i+1:]:
    a+=d[i]*d[j]
print(a)

### FIXED CODE ###

n=int(input())
d = list(map(int, input().split()))
a=0
for i in range(0,n,1):
  if i==n:
     break
  for j in d[i+1:]:
    a+=d[i]*j
print(a)
c = 0
result = 0
while:
    st = raw_input()
    if c = 0:
        s_str = st
    elif 'END_OF_TEXT' in st:
        break
    else:
        if s_str in str:
            result = result + 1
        else:
            pass
print result

### FIXED CODE ###

c = 0
result = 0
while True:
    st = raw_input()
    if c == 0:
        s_str = st
    elif 'END_OF_TEXT' == st:
        break
    elif c > 0:
        if s_str.lower() in st.lower():
            result = result + st.lower().split(' ').count(s_str.lower())
        else:
            pass
    c = c+1
print result
n, a, b = input().split()
 
d = n // (a + b)
m = n % (a + b)
 
blue = a * d
if m >= a:
  blue = blue + a
else:
  blue = blue + m
  
print(blue)

### FIXED CODE ###

n, a, b = input().split()
n = int(n)
a = int(a)
b = int(b)
 
d = n // (a + b)
m = n % (a + b)
 
blue = a * d
if m >= a:
  blue = blue + a
else:
  blue = blue + m
  
print(blue)
import sys

input = sys.stdin.readline

def main():
	N, M, L = list(map(int,input().split()))
	P = [list(map(int,input().split())) for i in range(M)]
	Q = int(input())
	st = [list(map(int,input().split())) for i in range(Q)]

	neighbor = [[] for i in range(N)]
	for pi in P:
		if pi[2]<=L:
			neighbor[pi[0]-1].append((pi[1]-1,pi[2]))
			neighbor[pi[1]-1].append((pi[0]-1,pi[2]))

	fuellist = [0]*N
	n_append = nq.append
	def bfs(start, end):
		fuel = [[10000000,L+1] for i in range(N)]
		fuel[start][0] = 0
		fuel[start][1] = L
		queue = [start]
		while len(queue)>0:
			nq = []						# next target node
			for i in queue:				# target node
				oc, om = fuel[i]
				for j, d in neighbor[i]:	# next node
					if om<d:
						nc = oc+1
						nm = L-d
					else:
						nc = oc
						nm = om-d

					# print(i,j,nc,nm)

					if (nc<fuel[j][0]) or (nc==fuel[j][0] and nm>fuel[j][1]):
						fuel[j][0], fuel[j][1] = nc, nm
						n_append(j)

			queue = nq					# update target node

		ans = fuel[end][0]
		if fuel[end][0]==10000000: ans = -1

		fuellist[start] = fuel

		print(ans)

	for s, t in st:
		start, end = s-1, t-1
		if fuellist[start]==0:
			bfs(start,end)
		else:
			ans = fuellist[start][end][0]
			if ans==10000000: ans = -1
			print(ans)


if __name__ == '__main__':
	main()

### FIXED CODE ###

import sys


def main():
	input = sys.stdin.readline
	N, M, L = list(map(int,input().split()))
	P = [list(map(int,input().split())) for i in range(M)]
	Q = int(input())
	st = [list(map(int,input().split())) for i in range(Q)]

	neighbor = [[] for i in range(N)]
	for s,e,d in P:
		if d<=L:
			neighbor[s-1].append((e-1,d))
			neighbor[e-1].append((s-1,d))
		# if d<=L:
		# 	neighbor[s-1][e-1] = neighbor[e-1][s-1] = d

	# print(neighbor)
	# start, end = 2,1

	fuellist = [0]*N
	def bfs(start, end):
		# fuel = [[10000000,L+1] for i in range(N)]
		fuelc, fuelm = [10000000]*N, [L+1]*N
		# fuel[start][0] = 0
		# fuel[start][1] = L
		fuelc[start], fuelm[start] = 0, L
		queue = [start]
		while len(queue)>0:
			nq = []						# next target node
			nq_append = nq.append
			for i in queue:				# target node
				oc, om = fuelc[i], fuelm[i]
				for j, d in neighbor[i]:
				# for j, d in enumerate(neighbor[i]):	# next node
					# if d==10**10: continue
					if om<d:
						nc = oc+1
						nm = L-d
					else:
						nc = oc
						nm = om-d

					# print(i,j,nc,nm)

					if nc<fuelc[j]:
						fuelc[j], fuelm[j] = nc, nm
						nq_append(j)
					elif nc==fuelc[j] and nm>fuelm[j]:
						fuelm[j] = nm
						nq_append(j)

			queue = nq					# update target node

		# ans = fuel[end][0]
		ans = fuelc[end]
		if ans==10000000: ans = -1

		fuellist[start] = fuelc

		print(ans)

	for s, t in st:
		start, end = s-1, t-1

		if fuellist[start]!=0:
			ans = fuellist[start][end]
			if ans==10000000: ans = -1
			print(ans)
		elif fuellist[end]!=0:
			ans = fuellist[end][start]
			if ans==10000000: ans = -1
			print(ans)
		else:
			bfs(start,end)


if __name__ == '__main__':
	main()
import operator
from functools import reduce


def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(operator.mul, range(n, n-r, -1), 1)
    denom = reduce(operator.mul, range(1, r+1), 1)
    return numer // denom


def calc_step2patterns(num_step):
    pats = 0
    for j in range(0, (num_step//2)+1):
        pats += ncr(num_step-j, j)
    return pats


def step2patterns(num_step, step_dict):
    try:
        return step_dict[num_step]
    except KeyError:
        ret = calc_step2patterns(num_step)
        step_dict[num_step] = ret
        return ret


num_stair, num_wet = map(int, input().split(' '))

last_wet = -1
num_pattern = 1
d = {}

for i in range(0, num_wet):
    wet = int(input())
    dry_step = wet - last_wet - 1
    last_wet = wet

    if dry_step <= 0:
        print('0')
        exit(0)

    elif dry_step == 1 or dry_step == 2:
        continue

    else:
        num_pattern *= step2patterns(dry_step - 1, d)

# last step
dry_step = num_stair - last_wet

num_pattern *= step2patterns(dry_step - 1)

print(num_pattern % 1000000007)
exit(0)


### FIXED CODE ###

def exec_ncr(max_step, record_dict):
    for i in range(2, max_step+1):
        record_dict[i] = record_dict[i-1] + record_dict[i-2]


num_stair, num_wet = map(int, input().split(' '))

last_wet = -1
num_pattern = 1
d = {0: 1, 1: 1}
exec_ncr(num_stair, d)

for i in range(0, num_wet):
    wet = int(input())
    dry_step = wet - last_wet - 1
    last_wet = wet

    if dry_step <= 0:
        print('0')
        exit(0)

    elif dry_step == 1 or dry_step == 2:
        continue

    else:
        num_pattern *= d[dry_step-1]

# last step
dry_step = num_stair - last_wet

num_pattern *= d[dry_step-1]

print(num_pattern % 1000000007)
exit(0)
N, W = map(int, input().split())
T = [list(map(int, input().split())) for _ in range(N)]

dp = [[0] + [-1] * W for _ in range(N+1)]
dp[0] = [0] * (W+1)

for i in range(1, N+1):
    for w in range(1, W+1):
        dp[i][w] = max(dp[i-1][w], dp[i-1][w - T[i-1][0]] + T[i-1]
                       [1]) if w - T[i-1][0] >= 0 else dp[i-1][w]

# print(*dp, sep='\n')
print(dp[N][W])


### FIXED CODE ###

N, L = map(int, input().split())
W = []
V = []
for _ in range(N):
    w, v = map(int, input().split())
    W.append(w)
    V.append(v)

VMAX = 10**5 + 100
ans = 0
dp = [[float('inf')] * (VMAX+1) for _ in range(N+1)]
dp[0][0] = 0
for n in range(N):
    for v in range(VMAX):
        if dp[n][v] != float('inf'):
            dp[n+1][v] = min(dp[n+1][v], dp[n][v])
            dp[n+1][v+V[n]] = min(dp[n+1][v+V[n]], dp[n][v] + W[n])

            if dp[n+1][v+V[n]] <= L:
                ans = max(ans, v+V[n])
# print(*dp, sep='\n')
print(ans)
import math

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

ans=-1
for i in range(1,B*10+1)
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        ans=i
        break

print(ans)

### FIXED CODE ###

import math

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

ans=-1
for i in range(1,1001):
    if math.floor(i*0.08)==A and math.floor(i*0.1)==B:
        ans=i
        break

print(ans)
n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []


for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for li in range(l):
    print(" ".join([str(s) for s in C[li]]))

### FIXED CODE ###

n, m, l = [int(i) for i in input().split()]

A = []
B = []
C = []

for ni in range(n):
    A.append([int(i) for i in input().split()])

for mi in range(m):
    B.append([int(i) for i in input().split()])

for i in range(n):
    C.append([])
    for j in range(l):
        C[i].append(0)
        for k in range(m):
            C[i][j] += A[i][k] * B[k][j]

for li in range(n):
    print(" ".join([str(s) for s in C[li]]))
s = input()
set = {'A', 'T', 'G', 'C'}
l, ans = 0, 0
for i in len(s):
  if s[i] in set:
    l += 1
  else:
    ans = max(l, ans)
    l = 0
print(ans)

### FIXED CODE ###

s = input()
set = {'A', 'T', 'G', 'C'}
l, ans = 0, 0
for i in range(len(s)):
  if s[i] in set:
    l += 1
  else:
    ans = max(l, ans)
    l = 0
ans = max(l, ans)
print(ans)
n = int(input())
a = []
for i in range(n):
	a.append(int(input()))

sort_a = sorted(list(set(a)))

for i in range(n):
	if a[i] == sort_a[-1]:
		print(sort_a[-2])
	else:
		print(sort_a[-1])



### FIXED CODE ###

n = int(input())
a = []
for i in range(n):
	a.append(int(input()))

sort_a = sorted(a)

for i in range(n):
	if a[i] == sort_a[-1]:
		print(sort_a[-2])
	else:
		print(sort_a[-1])