Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import math


def get_prime(num):
    upper = int(math.sqrt(num)) + 1
    checks = [True for _ in range(upper + 1)]
    primes = []
    for i in range(2, len(checks)):
        if checks[i]:
            primes.append(i)
            for j in range(i, len(checks), i):
                checks[j] = False
    return primes


n, m = map(int, input().split(" "))
answer = 1
# for p in get_prime(m):
for p in range(1, m // n + 1):
    if m % p == 0:
        answer = p
print(answer)


### FIXED CODE ###

n, m = map(int, input().split())
d = [i for i in range(1, int(m**0.5) + 1) if m % i == 0]
d.extend([m // i for i in d])
print(max([i for i in d if m // i >= n]))
### BUGGY CODE ###

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

inf = float("inf")
dp = [inf for _ in range(N + 1)]
dp[1] = 0
for i in range(1, N + 1):
    for k in range(1, K + 1):
        if i + k <= N:
            if dp[i + k] > dp[i] + abs(h_list[i - 1] - h_list[i - 1 + k]):
                dp[i + k] = dp[i] + abs(h_list[i - 1] - h_list[i - 1 + k])

print(dp[N])

### FIXED CODE ###

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

dp = [float("inf") for _ in range(N + 1)]
dp[1] = 0
for i in range(1, N+1):
    for k in range(1, K+1):
        if i + k <= N:
            dp[i+k] = min(dp[i + k], dp[i] + abs(h_list[i-1] - h_list[i-1+k]))

print(dp[N])
### BUGGY CODE ###

N = int(input())

c = 10**7

for a in range(2, (N+1)//2):
    if N % a == 0:
        b = N / a
        if (a-1)+(b-1) < c:
            c = (a-1)+(b-1)
        
print(min((N-1), int(c)))

### FIXED CODE ###

N = int(input())

c = 10**100

for a in range(2, int(N**0.5)+1):
    if N % a == 0:
        b = N / a
        if (a-1)+(b-1) < c:
            c = (a-1)+(b-1)
        
print(min((N-1), int(c)))
### BUGGY CODE ###

N, x, y = list(map(int, input().split()))
INF = 10 ** 100
adj_mtx = [ [INF] * (N+1) for _ in range(N+1) ]

for i in range(1, N+1):
  if i != N:
    adj_mtx[i][i] = 0
    adj_mtx[i][i+1] = 1
    adj_mtx[i+1][i] = 1
adj_mtx[x][y] = 1
adj_mtx[y][x] = 1

for k in range(1, N+1):
  for i in range(1, N+1):
    for j in range(1, N+1):
      adj_mtx[i][j] = min(adj_mtx[i][j], adj_mtx[i][k] + adj_mtx[k][j])

for i in range(1, N):
  print(sum([ r.count(i) for r in adj_mtx ]) // 2)

### FIXED CODE ###

N, X, Y = list(map(int, input().split()))
result = [0] * N


for i in range(1, N):
  for j in range(i+1, N+1):
    step = min( j-i, abs(i-X)+1+abs(j-Y), abs(i-Y)+1+abs(j-X))
    result[step] += 1

for e in result[1:]: print(e)
### BUGGY CODE ###

a, b, k = map(int,input().split())
lst = [i for i in range(a, b+1) if i <(a+k) or i > (b-k)]

for i in range(len(lst)):
    print(lst[i])

### FIXED CODE ###

a, b, k = map(int,input().split())
maximum = 0

if(a+k <= b):
    for i in range(a, a+k):
        print(i)
        maximum = i
    for j in range(b-k+1, b+1):
        if(maximum < j):
            print(j)
        
else:
    for i in range(a, b+1):
        print(i)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
N = int(input())
S = []
for x in range(N):
    S.append(input().rstrip())
S_label_n = []
S_label = list(set(S))
for x in S_label:
    S_label_n.append(S.count(x))
max_n =max(S_label_n)
maxIndex = [i for i, x in enumerate(S_label_n) if x ==max_n ]
ans_list = []
for x in maxIndex:
    ans_list.append(S_label[x])
ans_list.sort()
for x in ans_list:
    print(x)

### FIXED CODE ###

import sys
input = sys.stdin.readline
N = int(input())
dictS = {}
for x in range(N):
    tmp = input().rstrip()
    if tmp in dictS:
        dictS[tmp] = dictS[tmp]+1
    else:
        dictS[tmp]=1
        
max_n =max(dictS.values())
maxIndex = [x for x in dictS.items() if x[1] ==max_n ]
ans_list = []
for x in maxIndex:
    ans_list.append(x[0])
ans_list.sort()
for x in ans_list:
    print(x)
### BUGGY CODE ###

a,b=(int(x) for x in input().split())
count = 0
l = range(a+1)

for x in l:
  for y in l:
    for z in l:
      if (x+y+z) == b:
        count+=1

print(count)

### FIXED CODE ###

import itertools
a,b=(int(x) for x in input().split())
l = range(a+1)
count = 0
m = [x+y for x,y in itertools.product(l,l) if (x+y)<=b]
for i in m:
  if b-i <= a:
    count+=1
print(count)
### BUGGY CODE ###

#AGC033-A Darker and Darker
"""
マンハッタン距離で最も白マスと黒マスの遠いところが答え
"""
import sys
from collections import deque
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

#迷路plane
H,W = map(int,readline().split())
maze = []
for _ in range(H):
    maze += [list(readline().rstrip().decode())]

def dfs(i,j):
    deq = deque([[i,j,1]])
    while deq:
        h,w,now = deq.popleft()
        for a,b in [(0,1),(1,0),(0,-1),(-1,0)]:
            if not (0 <= h+a < H and 0 <= w+b < W):continue
            if maze[h+a][w+b] == "#":return now
            else:deq.append([h+a,w+b,now+1])

ans = 0
for i in range(H):
    for j in range(W):
        if maze[i][j] == ".":
            ans = max(ans,dfs(i,j))

print(ans)

### FIXED CODE ###

#AGC033-A Darker and Darker
"""
愚直にbfs(queueが無くなるまで)
"""
import sys
from collections import deque
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

#迷路plane
H,W = map(int,readline().split())
maze = []
for _ in range(H):
    maze += [list(readline().rstrip().decode())]

def bfs(lst):
    deq = deque(lst)
    ans = 0
    while deq:
        h,w,now = deq.popleft()
        for a,b in [(0,1),(1,0),(0,-1),(-1,0)]:
            if not (0 <= h+a < H and 0 <= w+b < W):continue
            if maze[h+a][w+b]=="#":continue
            else:
                maze[h+a][w+b] = "#"
                ans = max(ans,now+1)
                deq.append([h+a,w+b,now+1])
    return ans

lst1 = []
for i in range(H):
    for j in range(W):
        if maze[i][j] == "#":
            lst1.append([i,j,0])

print(bfs(lst1))
### BUGGY CODE ###

from math import factorial

N,A,B,K = map(int, raw_input().split())
mod=998244353

def ncr(n,r):
    # 10C7 = 10C3
    r = min(r, n-r)

    # Calculate the numerator.
    numerator = 1
    for i in range(n, n-r, -1):
        numerator *= i

    # Calculate the denominator. Should use math.factorial?
    denominator = 1
    for i in range(r, 1, -1):
        denominator *= i

    return numerator // denominator


if K==0: print 1;quit()

y=0
ans=0
for x in range(1,N+1):
	if (K-A*x)%B==0:
		y=(K-A*x)/B
		ans+=(ncr(N,x))%mod*(ncr(N,y))%mod

print ans


### FIXED CODE ###

N,A,B,K = map(int, raw_input().split())


mod=998244353
fact, inv_fact = [1], [1]
fact_tmp = 1
for i in range(1, N+1):
    fact_tmp *= i
    fact_tmp %= mod
    fact.append(fact_tmp)
    inv_fact.append(pow(fact_tmp, mod-2, mod))


def ncr(n,r):
	if n < 0 or r < 0 or n < r:
		return 0
	else:
		return (fact[n] * inv_fact[r] * inv_fact[n-r]) %mod

y=0
ans=0
for x in range(N+1):
	if (K-A*x)%B==0:
		if K-A*x<0: break
		y=(K-A*x)/B
		if y>N: continue
		ans+=(ncr(N,x))%mod*(ncr(N,y))%mod

print ans%mod
### BUGGY CODE ###

import itertools

def D():
    n = input()
    l = list(map(int,input().split(" ")))
    temp = list(itertools.combinations(l,3))
    count = 0
    #print(temp)
    res = [i for i in temp if i[0] < i[1]+i[2] and i[1] < i[0]+i[2] and i[2] < i[0]+i[1]]
    print(len(res))

if __name__ == '__main__':
    D()

### FIXED CODE ###

import itertools
import bisect

def D():
    n = input()
    l = map(int,input().split(" "))
    temp = itertools.combinations(l,3)
    count = 0
    #print(temp)
    #res = [i for i in temp if i[0] < i[1]+i[2] and i[1] < i[0]+i[2] and i[2] < i[0]+i[1]]
    for i in temp:
        i = sorted(list(i),reverse=True)
        if i[0] < i[1]+i[2]:
            count += 1
    print(count)

def D_sort():
    N = int(input())
    L = sorted([int(_) for _ in input().split()])
    #L[a] + L[b] > L[c]
    ans = 0
    for a in range(N - 2):
        for b in range(a + 1, N - 1):
            ans += bisect.bisect(L, L[a] + L[b] - 1) - b - 1
            #右挿入二分探索で得たインデックス-2つ目に長い辺のインデックス=その2辺で作れる三角形の個数
            #(この間に入っている辺を使う分には三角形成立条件が必ず満たされている)
    print(ans)
if __name__ == '__main__':
    D_sort()
### BUGGY CODE ###

from itertools import groupby

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

num = []
cot = []
for k, n in groupby(S):
  num.append(k)
  cot.append(len(list(n)))

if num[0] == "1":
  x = K*2+1
else:
  x = K*2

ans = 0
for i in range(len(cot)-x+1):
  if num[i] == "1":
    x = K*2+1
  else:
    x = K*2
  ans = max(ans,sum(cot[i:i+x]))
if ans == 0:
  ans = len(S)
print(ans)

### FIXED CODE ###

def main():
  from itertools import groupby

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

  num = []
  cot = []
  for k, n in groupby(S):
    num.append(k)
    cot.append(len(list(n)))

  if num[-1] == "0":
    cot += [0]
    num += [0]

  X = [0]*(len(cot)+1)
  for i in range(len(cot)):
    X[i+1] = X[i]+cot[i]

  ans = 0
  for i in range(len(X)):
    x = K*2
    if num[i] == "1":
      x += 1
    try:
      ans = max(ans, X[i+x]-X[i])
    except:
      break
  if ans == 0:
    ans = len(S)
  print(ans)

if __name__ == '__main__':
  main()
### BUGGY CODE ###

import sys

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

def int_to_bits(x):
    return [ 1 if 2**i & x != 0 else 0 for i in range(60) ]

def inv(x, MOD):
    return pow(x, MOD-2, MOD)

MOD = 10**9+7

n,*A = get_all_int()

# ビットごとの出現回数 2**i
bits = [0] * 60

for a in A:
    for i in range(60):
        if 2**i & a != 0:
            bits[i] += 1

# log("bits:", bits)

ans = 0

for a in A:
    a_bits = int_to_bits(a)
    a_dash = list(map(lambda a: a*(n-1), a_bits))

    # log("a_dash", a_dash)

    bits_dash = [ bits[i] - a_bits[i] for i in range(60)]

    # log("bits_dash", bits_dash)

    for i in range(60):
        ans = (ans + 2**i * abs(bits_dash[i] - a_dash[i])) % MOD
    # log(a, ans)

print(ans * inv(2, MOD) % MOD)


### FIXED CODE ###

import sys
import time

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

def int_to_bits(x):
    return [ 1 if 2**i & x != 0 else 0 for i in range(60) ]

def inv(x, MOD):
    return pow(x, MOD-2, MOD)

start = time.time()

MOD = 10**9+7

debug = False

if debug:
    n = 30 * 10000
    A = list(range(n))
else:
    n,*A = get_all_int()

# ビットごとの出現回数 2**i
bits = [0] * 60

for a in A:
    for i in range(60):
        if 2**i & a != 0:
            bits[i] += 1

# log("bits:", bits)
# log("bits.", time.time() - start)

# ans = 0

ans = sum(( pow(2, i, MOD) * bits[i] * (n-bits[i]) for i in range(60))) % MOD

# for a in A:
#     # a_bits = [ 1 if 2**i & a != 0 else 0 for i in range(60) ]

#     for i in range(60):
#         ans += 2**i * abs(bits[i] - (1 if 2**i & a != 0 else 0) *n)

#     # a_dash = list(map(lambda a: a*(n-1), a_bits))

#     # log("a_dash", a_dash)

#     # bits_dash = [ bits[i] - a_bits[i] for i in range(60)]
#     # log("bits_dash", bits_dash)
#     # ans += sum( ( 2**i * abs(bits_dash[i]-2*a_dash[i])) for i in range(60) )

#     # ans += sum( ( 2**i * abs(bits[i]-2*a_dash[i])) for i in range(60) )

#     # for i in range(60):
#     #     ans = (ans + 2**i * abs(bits_dash[i] - a_dash[i])) % MOD
#     # log(a, ans)

# print(ans//2 % MOD)
print(ans)
# log("end.", time.time() - start)
### BUGGY CODE ###

N,Q = map(int,input().split())
S = input()
z = []
for j in range(N-1):
  if S[j]+S[j+1]=='AC':
    z.append(j+1)
for i in range(Q):
  l,r = map(int,input().split())
  l = l
  r = r
  ans = [x for x in z if x >= l and x<= r-1]
  print(len(ans))


### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
  t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
  l, r = map(int, input().split())
  print(t[r-1] - t[l-1])
### BUGGY CODE ###

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

A = sorted(A)

seed = []

while A:    
    wareta = []
    warenai = []

    q = A.pop(0)
    for a in A:
        if a % q == 0:
            wareta.append(a)
        else:
            warenai.append(a)

    if q not in wareta:
        seed.append(q) 

    A = warenai[:]

print(len(seed))

### FIXED CODE ###

from collections import Counter

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

maxA = max(A)
C = Counter(A)

D = {a: 0 for a in A}
for a in A:
  t = 2
  while a * t <= maxA:
      D[a * t] = 1
      t += 1

ans = 0
for a in A:
    if C[a] == 1 and D[a] == 0:
        ans += 1

print(ans)
### BUGGY CODE ###

h,w=map(int,input().split())
ch,cw=map(int,input().split())
dh,dw=map(int,input().split())
s=[0]*h
for i in range(h):
  st=str(input())
  st=list(st)
  s[i]=st
  
from collections import deque
temp=[[999999]*w for i in range(h)]
temp2=[[0]*w for i in range(h)]
temp[ch-1][cw-1]=0
queue = deque([[ch-1, cw-1]])
while queue:  
  x,y=queue.popleft()
  for i,j in [[1,0],[-1,0],[0,1],[0,-1],[2,2],[2,1],[2,0],[2,-1],[2,-2],[1,2],[1,1],[1,-1],[1,-2],[0,2],[0,-2],[-1,2],[-1,1],[-1,-1],[-1,-2],[-2,2],[-2,1],[-2,0],[-2,-1],[-2,-2]]:
    xtemp,ytemp=x+i,y+j
    if xtemp<0 or h<=xtemp or ytemp<0 or w<=ytemp or s[xtemp][ytemp]!=".":
      continue
    if temp[xtemp][ytemp]<=temp[x][y]:
      continue
    if (i==1 and j==0) or (i==-1 and j==0) or (i==0 and j==1) or (i==0 and j==-1):
      temp[xtemp][ytemp]=min(temp[xtemp][ytemp],temp[x][y])
    else:
      temp[xtemp][ytemp]=min(temp[xtemp][ytemp],temp[x][y]+1)
    queue.append([xtemp,ytemp])

if temp[dh-1][dw-1]==999999:
  print(-1)
else:
  print(temp[dh-1][dw-1])

### FIXED CODE ###

h,w=map(int,input().split())
ch,cw=map(int,input().split())
dh,dw=map(int,input().split())
s=[0]*h
for i in range(h):
  st=str(input())
  st=list(st)
  s[i]=st
  
from collections import deque
temp=[[999999]*w for i in range(h)]
temp[ch-1][cw-1]=0
queue0 = deque([[ch-1, cw-1, 0]])
queue1 = deque()
while queue0:  
  x,y,c=queue0.popleft()
  queue1.append((x,y,c))
  for i,j in [[1,0],[-1,0],[0,1],[0,-1]]:
    xtemp,ytemp=x+i,y+j
    if xtemp<0 or h<=xtemp or ytemp<0 or w<=ytemp or s[xtemp][ytemp]!=".":
      continue
    if temp[xtemp][ytemp]<=c:
      continue
    temp[xtemp][ytemp]=c
    queue0.append([xtemp,ytemp,temp[xtemp][ytemp]])
    
  if len(queue0)==0:      
    while queue1:
      x,y,c=queue1.popleft()
      for i,j in [[2,2],[2,1],[2,0],[2,-1],[2,-2],[1,2],[1,1],[1,-1],[1,-2],[0,2],[0,-2],[-1,2],[-1,1],[-1,-1],[-1,-2],[-2,2],[-2,1],[-2,0],[-2,-1],[-2,-2]]:
        xtemp,ytemp=x+i,y+j
        if xtemp<0 or h<=xtemp or ytemp<0 or w<=ytemp or s[xtemp][ytemp]!=".":
          continue
        if temp[xtemp][ytemp]<=c+1:
          continue
        temp[xtemp][ytemp]=c+1
        queue0.append([xtemp,ytemp,temp[xtemp][ytemp]])
        
if temp[dh-1][dw-1]==999999:
  print(-1)
else:
  print(temp[dh-1][dw-1])
### BUGGY CODE ###

from collections import Counter
from functools import reduce
import bisect
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  # LIST INT
def LF(): return [float(x) for x in sys.stdin.readline().split()]  # LIST FLOAT
def LS(): return sys.stdin.readline().split()  # LIST STRING
def MI(): return map(int, sys.stdin.readline().split())  # MAP INT
def II(): return int(sys.stdin.readline())  # INPUT INT
def IS(): return input()  # INPUT STRING
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  # Greatest Common Divisor
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  # Least Common Multiple
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))


n = II()
v = LI()
c = LI()
y = 0
maxi = -1000000000000
for i in range(2 ** n):
    total = 0
    y =0
    for j in range(n):
        if ((i >> j) & 1):
            total += v[j]
            y += c[j]
    maxi = max(maxi, total-y)

print(maxi)


### FIXED CODE ###

from collections import Counter
from functools import reduce
import bisect
import fractions
import math
import statistics
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]  # LIST INT
def LF(): return [float(x) for x in sys.stdin.readline().split()]  # LIST FLOAT
def LS(): return sys.stdin.readline().split()  # LIST STRING
def MI(): return map(int, sys.stdin.readline().split())  # MAP INT
def II(): return int(sys.stdin.readline())  # INPUT INT
def IS(): return input()  # INPUT STRING
def P(x): return print(x)
def C(x): return Counter(x)
def GCD_LIST(numbers):  # Greatest Common Divisor
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):  # Least Common Multiple
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))


n = II()
v = LI()
c = LI()
xy = [v[i] - c[i] for i in range(n)]
print(sum([ xy[i] for i in range(n) if xy[i] > 0]))
### BUGGY CODE ###

N, K = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(K)]

S = []
for i in range(K):
  for j in range(X[i][0], X[i][1]+1): S.append(j)

mod = 998244353
dp = [0] * N
dp[0] = 1

# N-1個目のマスまでdp
for i in range(N-1):
  for j in S:
    if 0 <= i + j <= N-1:
      dp[i+j] += dp[i]
      dp[i+j] %= mod
    else: continue

print(dp[N-1])

### FIXED CODE ###

N, K = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(K)]
 
# dpの高速化 => 累積和によって、O(N)で解く
dp = [0] * N
acc = [0]* (N+1)
dp[0], acc[1] = 1, 1
# acc[0] = 0
# acc[1] = dp[0]
# acc[2] = dp[0] + dp[1]
# acc[n] = dp[0] + dp[1] + dp[n-1]

# dp[0] = acc[1] - acc[0]
# dp[1] = acc[2] - acc[1]
# dp[n-1] = acc[n] - acc[n-1]
mod = 998244353
 
for i in range(1, N):
  # acc[i] = dp[0] + ... + dp[i-1] が既知
  # 貰うdp
  for j in range(K):
    r = i - X[j][0]
    l = i - X[j][1]
    if r < 0: continue
    l = max(l, 0)
      
    dp[i] += acc[r+1] - acc[l] # s = dp[L] + ... + dp[R]
    dp[i] %= mod
  acc[i+1] = acc[i] + dp[i] # acc[i+1] = dp[0] + ... + dp[i]

print(dp[N-1])
### BUGGY CODE ###

from copy import deepcopy
n,m = (int(i) for i in input().split())
p = [int(i) for i in input().split()]
x = [[int(i) for i in input().split()] for i in range(m)]
c,d,e = [[] for i in range(n+1)],[True for i in range(n+1)],[]
d[0],ans = False,0
for i,j in x:
	c[i].append(j)
	c[j].append(i)
while sum(d)!=0:
	for i in range(n+1):
		if d[i]: break
	num2,numx,d[i] = set([i]),[i],False
	while True:
		num3 = set([])
		for i2 in list(num2):
			for j in c[i2]:
				if d[j]:
					num3.add(j)
					d[j] = False
		if len(num3)==0: break
		else:
			num2,num3 = deepcopy(num3),set([])
			for i in num2: numx.append(i)
	e.append(numx)
for i in e:
	for j in i:
		if p[j-1] in i: ans+=1
print(ans)

### FIXED CODE ###

n,m = (int(i) for i in input().split())
par,rank = [i for i in range(n+1)],[0 for i in range(n+1)]
def root(x):
	if par[x]!=x: par[x] = root(par[x])
	return par[x]
def unite(x,y):
	x2,y2 = root(x),root(y)
	if x2!=y2:
		if rank[x2]<rank[y2]: par[x2] = y2
		else: par[y2] = x2
		if rank[x2]==rank[y2]: rank[x2]+=1
p = [int(i) for i in input().split()]
x = [[int(i) for i in input().split()] for i in range(m)]
for i,j in x: unite(i,j)
ans = -1
for i,j in enumerate([0]+p):
	if root(i)==root(j): ans += 1
print(ans)
### BUGGY CODE ###

N, K = [int(i) for i in input().split()]
ans = []
for i in range(N):
    A,B = [int(i) for i in input().split()]
    for b in range(B):
        ans.append(A)
ans.sort()
print(ans[K-1])




### FIXED CODE ###

N, K = [int(i) for i in input().split()]
ans = []
A = [[]*2]*N
num = 0
for i in range(N):
    A[i] = [int(i) for i in input().split()]
A.sort()
i = 0
while num < K:
    num += A[i][1]
    i += 1

print(A[i-1][0])
### BUGGY CODE ###

n = int(input())
alist = list(map(int,input().split()))
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

adic = {}
ans = 0
for i in alist:
  if i not in adic:
    adic[i] = 1
  else:
    adic[i] += 1
for i in range(n):
  for j in adic:
    if j == alist[i]:
      if adic[j] >= 3:
        ans += cmb(adic[j]-1,2)
      else:
        ans += 0
    else:
      if adic[j] >= 2:
        ans += cmb(adic[j],2)
      else:
        ans += 0
  print(ans)
  ans = 0

### FIXED CODE ###

import sys
input = sys.stdin.readline
n = int(input())
alist = list(map(int,input().split()))
aalist = [0]*n
aset = set(alist)
adic = {}
for a in alist:
    if a not in adic:
        adic[a] = 0
    adic[a] += 1
a_counter = list(adic.items())

sigma = 0
for counter in a_counter:
    sigma += counter[1] * (counter[1] - 1) // 2

for i in range(n):
    aalist[i] = adic[alist[i]]-1

anslist = []
for a in aalist:
    anslist.append(sigma - a)

for ans in anslist:
    print(ans)
### BUGGY CODE ###

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

XY = []
for _ in range(N):
    x, y = map(int, input().split())
    XY.append((x, y))
    
dots = XY[:]

import sys
INT_MAX = sys.maxsize

ans = INT_MAX

import itertools
for ((left_x, _), (right_x, _)) in itertools.permutations(dots, 2):
    if left_x > right_x:
        left_x, right_x = right_x, left_x
    
    for ((_, under_y), (_, top_y)) in itertools.permutations(dots, 2):
        if under_y > top_y:
            under_y, top_y = top_y, under_y
            
        counter = 0
        for d_x, d_y in dots:
            if  (left_x <= d_x) and (d_x <= right_x) and (under_y <= d_y) and (d_y <= top_y):
                counter += 1
                
        if counter >= K:
            area = (top_y-under_y) * (right_x-left_x)
            if ans > area:
                ans = area
            
print(ans)


### FIXED CODE ###

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

XY = []
for _ in range(N):
    x, y = map(int, input().split())
    XY.append((x, y))
    
dots = XY[:]

import sys
INT_MAX = sys.maxsize

ans = INT_MAX

import itertools
for ((left_x, _), (right_x, _)) in itertools.combinations(dots, 2):
    if left_x > right_x:
        left_x, right_x = right_x, left_x
    for ((_, under_y), (_, top_y)) in itertools.combinations(dots, 2):
        if under_y > top_y:
            under_y, top_y = top_y, under_y
        counter = 0
        for d_x, d_y in dots:
            if  (left_x <= d_x) and (d_x <= right_x) and (under_y <= d_y) and (d_y <= top_y):
                counter += 1
                
        if counter >= K:
            area = (top_y-under_y) * (right_x-left_x)
            if ans > area:
                ans = area
            
print(ans)
### BUGGY CODE ###

x, y, z, k = map(int, input().split())
ax = list(map(int, input().split()))
by = list(map(int, input().split()))
cz = list(map(int, input().split()))

ax.sort(reverse=True)
by.sort(reverse=True)
cz.sort(reverse=True)

ans = []
for a in ax[:min(x, 200)]:
    for b in by[:(min(y, 200))]:
        for c in cz[:min(z, 200)]:
            ans.append(a + b + c)

ans.sort(reverse=True)
for i in range(k):
    print(ans[i])


### FIXED CODE ###

x, y, z, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ab = []
for i in a:
    for j in b:
        ab.append(i+j)
ab.sort(reverse=True)
ab = ab[:k]

abc = []
for i in ab:
    for j in c:
        abc.append(i+j)
        
abc.sort(reverse=True)
for i in abc[:k]:
    print(i)
### BUGGY CODE ###

def solve():
	N, M = map(int, input().split())
	A = [int(input()) for _ in range(M)]

	dp = [0]*(N+1)
	dp[0] = 1
	if 1 in A:
		dp[1] = 0
	else:
		dp[1] = 1

	for i in range(2, N+1):
		if i in A:
			dp[i] = 0
		else:
			dp[i] = dp[i-1] + dp[i-2]

	print(dp[N]%1000000007)

solve()


### FIXED CODE ###

def solve():
	N, M = map(int, input().split())

	dp = [0]*(N+1)
	for _ in range(M):
		a = int(input())
		dp[a] = -1

	dp[0] = 1
	if dp[1]==-1:
		dp[1] = 0
	else:
		dp[1] = 1

	for i in range(2, N+1):
		if dp[i]==-1:
			dp[i] = 0
		else:
			dp[i] = dp[i-1] + dp[i-2]

	print(dp[N]%1000000007)

solve()