Harryxun/stf_run huggingface dataset:
n=int(input())
l=int(input())
ans=0
for i in range(0,len(l)):
  for j in range(i+1,len(l)):
    for k in range(j+1,len(l)):
      if l[i]>=l[j] and l[i]>=l[k]:
        if l[i]>l[j]+l[k]:
          ans+=1
        else:
          ans+=0
      if l[j]>=l[i] and l[j]>=l[k]:
        if l[j]>l[i]+l[k]:
          ans+=1
        else:
          ans+=0
      if l[k]>=l[i] and l[k]>=l[j]:
        if l[k]>l[i]+l[j]:
          ans+=1
        else:
          ans+=0   
print(ans)          


### FIXED CODE ###

import bisect
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(0,n-1):
  for j in range(i+1,n):
    x=l[i]+l[j]
    y=bisect.bisect_left(l,x)-1
    ans+=max((y-j),0)
    
print(ans)
A, B, K = map(int, input().split())
a = max(0, A-K)
K = max(0, K-A)
if K > 0:
    b = max(0, B-K)
print(str(a) + ' ' + str(b))

### FIXED CODE ###

A, B, K = map(int, input().split())
a = max(0, A-K)
K = max(0, K-A)
b = max(0, B-K)
print(str(a) + ' ' + str(b))
N = int(input())
S = input()

# print(S.count('ABC'))

cnt = 0
for i in range(N):
    if S[i] == 'A' and S[i + 1] == "B" and S[i + 2] == "C":
        cnt += 1

print(cnt)

### FIXED CODE ###

N = int(input())
S = input()

print(S.count('ABC'))
S = str(input())
ans = 10**3
for i in range(0, len(S)-2):
　　ans = min(ans, abs(753 - int(S[i:i+2])))
print(ans)

### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(S: int):
    S = str(S)
    ans = 10**3
    for i in range(0, len(S)-2):
        ans = min(ans, abs(753 - int(S[i:i+3])))
    print(ans)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = int(next(tokens))  # type: int
    solve(S)

if __name__ == '__main__':
    main()
def scanf(scanstr,data_format):
    scanstr=scanstr.split(" ")
    if(type(data_format) is not list):
        print("data_format error")
    if(len(scanstr)!=len(data_format)):
        print("Error")
        return -1
    j=0
    for kata in data_format:
        if(kata=="str"):
            scanstr[j]=str(scanstr[j])
        if(kata=="int"):
            scanstr[j]=int(scanstr[j])
        j=j+1
    return scanstr
import mylib
data=mylib.scanf(input(),["int","int"])
if data[0]!=1 and data[1]!=1:
    print(str(round(float(data[0]*data[1])/2.0+0.1)))
else:
    print(1)


### FIXED CODE ###

def scanf(scanstr,data_format):
    scanstr=scanstr.split(" ")
    if(type(data_format) is not list):
        print("data_format error")
    if(len(scanstr)!=len(data_format)):
        print("Error")
        return -1
    j=0
    for kata in data_format:
        if(kata=="str"):
            scanstr[j]=str(scanstr[j])
        if(kata=="int"):
            scanstr[j]=int(scanstr[j])
        j=j+1
    return scanstr
data=scanf(input(),["int","int"])
if data[0]==1 or data[1]==1:
    print(1)
elif (data[0]*data[0])%2==0:
    print(str(round((data[0]*data[1])/2)))
else:
    print(str(round((data[0]*data[1]+1)/2)))
n = int(input())
p = [int(input(i)) for i in range(n)]
count =0
for s,t in enumerate(p):
	print(s,t)
	if s !=(t-1):
		count+=1
if count == 2 or count == 0:
	print("YES")
else:
	print("NO")

### FIXED CODE ###

n = int(input())
p = map(int, list((input().split())))
count =0
for s,t in enumerate(p):
	if s !=(t-1):
		count+=1
if count == 2 or count == 0:
	print("YES")
else:
	print("NO")
#import numpy as np
#import math
#from decimal import *
#from numba import njit
from bisect import bisect_left

#@njit
def main():
    N = int(input())
    a = list(map(int, input().split()))
    edges = [[] for _ in range(N+1)]
    for _ in range(N-1):
        u,v = map(int, input().split())
        edges[u] += v,
        edges[v] += u,

    ans = [0]*(N+1)
    lastLis = []
    visited = [False]*(N+1)
    parent = {}
    n = 1
    stack = []

    def rec(n):
        nonlocal lastLis,stack
        #print(n, lastLis, stack)
        if not visited[n]:
            if len(lastLis) == 0 or a[n-1] > lastLis[-1]:
                lastLis.append(a[n-1])
                stack += (len(lastLis)-1, -1),
            else:
                index = bisect_left(lastLis, a[n-1])
                stack += (index, lastLis[index]),
                lastLis[index] = a[n-1]
            ans[n] = len(lastLis)
            visited[n] = True
        else:
            pass
        hasNext = False
        for d in edges[n]:
            if not visited[d]:
                parent[d] = n
                rec(d)
                hasNext = True
        # 巻き戻し
        index, value = stack.pop(len(stack)-1)
        if value < 0:
            lastLis.pop(index)
        else:
            lastLis[index] = value

    rec(1)
    for i in range(1, len(ans)):
        print(ans[i])




main()


### FIXED CODE ###

#import numpy as np
#import math
#from decimal import *
#from numba import njit
from bisect import bisect_left

#@njit
def main():
    N = int(input())
    a = list(map(int, input().split()))
    edges = [[] for _ in range(N+1)]
    for _ in range(N-1):
        u,v = map(int, input().split())
        edges[u] += v,
        edges[v] += u,

    ans = [0]*(N+1)
    lastLis = []
    visited = [False]*(N+1)
    parent = {}
    n = 1
    stack = []
    while True:
        #print(n, lastLis, stack)
        if not visited[n]:
            if len(lastLis) == 0 or a[n-1] > lastLis[-1]:
                lastLis.append(a[n-1])
                stack += (len(lastLis)-1, -1),
            else:
                index = bisect_left(lastLis, a[n-1])
                stack += (index, lastLis[index]),
                lastLis[index] = a[n-1]
            ans[n] = len(lastLis)
            visited[n] = True
        hasNext = False
        for d in edges[n]:
            if not visited[d]:
                parent[d] = n
                n = d
                hasNext = True
        if not hasNext:
            if n == 1:
                n = 0
                break
            n = parent[n]
            # 巻き戻し
            index, value = stack.pop(len(stack)-1)
            if value < 0:
                lastLis.pop(index)
            else:
                lastLis[index] = value

    for i in range(1, len(ans)):
        print(ans[i])




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

ans = 0

for i in x-1:
  if i in a:
    ans += 1

print(min(ans, m-ans))


### FIXED CODE ###

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

ans = 0

for i in a:
  if i < x:
    ans += 1

print(min(ans, m-ans))
import numpy as np
a,b,x = map(int,input().split())
V = a * a * b
dV = V - x
#y = max(V,dV)
#h = dV / V * b * 2
#theta = np.arctan(a / h) * 360 / (2 * np.pi)

if x >= V / 2:
  h = dV / V * b * 2
  theta = np.arctan(a / h) * 360 / (2 * np.pi)
  print(90-theta)
else:
  h = x / V * a * 2
  theta = np.arctan(h / b) * 360 / (2 * np.pi)
  print(90-theta)

### FIXED CODE ###

import numpy as np
a,b,x = map(int,input().split())
V = a * a * b
dV = V - x
if x == V:
  print("0")
  
elif x >= V / 2:
  h = dV / V * b * 2
  theta = np.arctan(a / h) * 360 / (2 * np.pi)
  print(90-theta)
  
else:
  h = x / V * a * 2
  theta = np.arctan(h / b) * 360 / (2 * np.pi)
  print(90-theta)
zn=int(input())
s,t=input(),split()
word=""
for i in range(n):
  word+=s[i]+t[i]
 
print(word)

### FIXED CODE ###

n=int(input())
s,t=input().split()

word=""
for i in range(n):
    word+=(s[i]+t[i])
print(word)
import sys
S=str(input())
s=list(S)
x,y=map(int,input().split())
fora=0
side=[]
updw=[]
side_p=[]
updw_p=[]
while s[0]=="F":
  fora+=1
  s.pop(0)
flag=1#1のとき横向き、-1のときたて向き
step=0
while s:
  if s[0]=="T":
    s.pop(0)
    if flag==-1: updw+=[step]
    else: side+=[step]
    flag=flag*(-1)
    step=0
  else:
    s.pop(0)
    if len(s)==0:
      if flag==-1: updw+=[step]
      else: side+=[step]
    step+=1
ypossi=len(side)
tpossi=len(updw)
xdp=[[0 for i in range(2*len(S)+1)] for j in range(ypossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
xdp[0][fora+len(S)]=1 
for i in range(ypossi):
  for j in range(2*len(S)+1):
    if j-side[i]>=0:
      if xdp[i][j-side[i]]==1:xdp[i+1][j]=1
    if j+side[i]<2*len(S)+1:
      if xdp[i][j+side[i]]==1:xdp[i+1][j]=1
        
ydp=[[0 for i in range(2*len(S)+1)] for j in range(tpossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
ydp[0][len(S)]=1 
for i in range(tpossi):
  for j in range(2*len(S)+1):
    if j-updw[i]>=0:
      if ydp[i][j-updw[i]]==1:ydp[i+1][j]=1
    if j+updw[i]<2*len(S)+1:
      if ydp[i][j+updw[i]]==1:ydp[i+1][j]=1
if xdp[ypossi][x+len(S)]==1 and ydp[tpossi][y+len(S)]==1:
  print("Yes")
else: print("No")

### FIXED CODE ###

S=str(input())
s=list(S)
x,y=map(int,input().split())
fora=0
side=[]
updw=[]
while s[0]=="F":
  fora+=1
  s.pop(0)
  if len(s)==0:break
flag=1#1のとき横向き、-1のときたて向き
step=0
while s:
  if s[0]=="T":
    s.pop(0)
    if step:
      if flag==-1: updw+=[step]
      else: side+=[step]
    flag=flag*(-1)
    step=0
  elif s[0]=="F":
    s.pop(0)
    step+=1
    if len(s)==0:
      if flag==-1: updw+=[step]
      else: side+=[step]
  else: break
ypossi=len(side)
tpossi=len(updw)
X=sum(side)+fora+abs(x)
Y=sum(updw)+abs(y)
xdp=[[0 for i in range(2*X+1)] for j in range(ypossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
xdp[0][fora+X]=1 
for i in range(ypossi):
  for j in range(2*X+1):
    if j-side[i]>=0:
      if xdp[i][j-side[i]]==1:xdp[i+1][j]=1
    if j+side[i]<2*X+1:
      if xdp[i][j+side[i]]==1:xdp[i+1][j]=1

ydp=[[0 for i in range(2*Y+1)] for j in range(tpossi+1)]
#dp[i][j] i個文字使ったときにj+len(s)は達成できるか
ydp[0][Y]=1 
for i in range(tpossi):
  for j in range(2*Y+1):
    if j-updw[i]>=0:
      if ydp[i][j-updw[i]]==1:ydp[i+1][j]=1
    if j+updw[i]<2*Y+1:
      if ydp[i][j+updw[i]]==1:ydp[i+1][j]=1
if xdp[ypossi][x+X]==1 and ydp[tpossi][y+Y]==1:
  print("Yes")
else: print("No")
n=int(input())
xyh = [list(map(int,input().split())) for i in range(n)]

ansh=-1
ans=[]
for cx in range(0,101):
  if len(ans)>0:
    break
  for cy in range(0,101):
    if len(ans)>0:
      break
    ansh = -1
    for pira in xyh:
      
      if pira[2] == 0 and pira[2]+abs(cx-pira[0])+abs(cy-pira[1])==0:
        ansh = pira[2]+abs(cx-pira[0])+abs(cy-pira[1])
        ans.append([cx,cy,ansh])
      
      elif pira[2] > 0 and ansh == -1:
        ansh = pira[2]+abs(cx-pira[0])+abs(cy-pira[1])
        ans.append([cx,cy,ansh])
        
      elif len(ans)>0 and pira[2] > 0 and ansh !=pira[2]+abs(cx-pira[0])+abs(cy-pira[1]):
        ans=[]
        break
        
      elif len(ans)>0 and pira[2]==0 and pira[2]+abs(cx-pira[0])+abs(cy-pira[1])>0:
        ans=[]
        break
print(*ans[0])


### FIXED CODE ###

n=int(input())
xyh = [list(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda x:x[2], reverse=True)

ansh=-1
ans=[[]]
flag=True
for cx in range(0,101):
  if flag==False:
    break
    
  for cy in range(0,101):
    ansh = 0
    for pira in xyh:
      if ansh==0:
        ansh=pira[2]+(abs(cx-pira[0])+abs(cy-pira[1]))
        ans[0]=[cx,cy,ansh]
        
      elif len(ans[0])>0 and max(ansh -(abs(cx-pira[0])+abs(cy-pira[1])), 0) != pira[2]:
        ans[0]=[]
    if len(ans[0])>0:
      flag=False
      break
print(*ans[0])
#coding:utf-8
n, a, b = map(int, input().split())

if a == 0 and b == 0:
    print(0)
    exit()

count = n // (a+b)
mod = n % (a+b)
#print(count, mod)

if mod != 0:
    ball = ('b'* a + 'r'* b) * (count + 1)
else:
    ball = ('b'* a + 'r'* b) * count

ans_ball = ball[:n]

print(ans_ball.count('b'))

### FIXED CODE ###

#coding:utf-8
n, a, b = map(int, input().split())

if a == 0 and b == 0:
    print(0)
    exit()

count = n // (a+b)
mod = n % (a+b)

ans = a * count + min(mod, a)
print(ans)
import functools
import fractions

def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N = int(input())
    A = list(map(int, input().split()))
    A = list(set(A))
    N = len(A) + 1
  else:
    # N = 3
    # A = [7,6,8]
    # N = 3
    # A = [12,15,18]
    N = 2
    A = [1000000000,1000000000]

  x = 0
  for i in range(N):
    if N == 1 : 
      tmp = 1000000000
    elif N == 2 :
      tmp = functools.reduce(fractions.gcd, A)
    else:
      if i+1=N:
        tmp = functools.reduce(fractions.gcd, A[0:i])
      else:
        tmp = functools.reduce(fractions.gcd, A[0:i]+A[i+1:])
    if tmp > x:
      x = tmp
  
  print(x)
  
main()

### FIXED CODE ###

import functools
import fractions

def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    N = int(input())
    A = list(map(int, input().split()))
  else:
    # N = 3
    # A = [7,6,8]
    N = 3
    A = [12,15,18]
    # N = 3
    # A = [1,1000000000,1000000000]

  AL = [0] * N    
  AR = [0] * N
  for i in range(N):
    if i != 0:
      AL[i] = fractions.gcd(AL[i-1],A[i])
    else:
      AL[i] = A[i]
    j = N - i - 1
    if j!= N - 1:
      AR[j] = fractions.gcd(AR[j+1],A[j])
    else:
      AR[j] = A[j]
      
  if 'get_ipython' in globals():   
    print(AL)
    print(AR)
  
  x = 0
  for i in range(N):
    if i == 0:
      tmp = AR[i+1]
    elif i == N - 1:
      tmp = AL[i-1]
    else:
      tmp = fractions.gcd(AL[i-1],AR[i+1])
    if tmp > x: x = tmp
  
  print(x)
    
main()
import statistics
import math
# N = int( input())

MOD = (10 ** 9) + 7
S = input()
dp = [ [ 0 for _ in range(4)]  for _ in range(len(S) + 1)]
dp[0][0] = 1
for i in range(len(S) ):
    if S[i] == "A":
        dp[i + 1][0] += dp[i][0]
        dp[i + 1][1] += (dp[i][0] + dp[i][1])
        dp[i + 1][2] += (dp[i][2])
        dp[i + 1][3] += dp[i][3]
    if S[i] == "B":
        dp[i + 1][0] += dp[i][0]
        dp[i + 1][1] +=dp[i][1]
        dp[i + 1][2] +=  (dp[i][1] + dp[i][2])
        dp[i + 1][3] +=dp[i][3]

    if S[i] == "C":
        dp[i + 1][0] += (dp[i][0])
        dp[i + 1][1] += dp[i][1]
        dp[i + 1][2] += dp[i][2]
        dp[i + 1][3] += (dp[i][2] + dp[i][3])

    if S[i] == "?":
        dp[i + 1][0] +=  (dp[i][0] * 3)
        dp[i + 1][1] += (dp[i][0] + (dp[i][1]) * 3)
        dp[i + 1][2] += (dp[i][1]+ (dp[i][2]) * 3)
        dp[i + 1][3] += (dp[i][2]+ (dp[i][3]) * 3)
    for i in range(0,4):
        dp[i + 1][i] %= MOD




print(dp[-1][3] % MOD)

### FIXED CODE ###

import math
# N = int( input())

MOD = (10 ** 9) + 7
S = input()
dp = [ [ 0 for _ in range(4)]  for _ in range(len(S) + 1)]
dp[0][0] = 1
for i in range(len(S) ):
    if S[i] == "A":
        dp[i + 1][0] += dp[i][0]
        dp[i + 1][1] += (dp[i][0] + dp[i][1])
        dp[i + 1][2] += (dp[i][2])
        dp[i + 1][3] += dp[i][3]
    if S[i] == "B":
        dp[i + 1][0] += dp[i][0]
        dp[i + 1][1] +=dp[i][1]
        dp[i + 1][2] +=  (dp[i][1] + dp[i][2])
        dp[i + 1][3] +=dp[i][3]

    if S[i] == "C":
        dp[i + 1][0] += (dp[i][0])
        dp[i + 1][1] += dp[i][1]
        dp[i + 1][2] += dp[i][2]
        dp[i + 1][3] += (dp[i][2] + dp[i][3])

    if S[i] == "?":
        dp[i + 1][0] +=  (dp[i][0] * 3)
        dp[i + 1][1] += (dp[i][0] + (dp[i][1]) * 3)
        dp[i + 1][2] += (dp[i][1]+ (dp[i][2]) * 3)
        dp[i + 1][3] += (dp[i][2]+ (dp[i][3]) * 3)
    for j in range(0,4):
        dp[i + 1][j] %= MOD




print(dp[-1][3] % MOD)
x, y, z = map(int, input().split())
i = 0
while True:
  if x - i*y - (i+1)*z >= 0:
    i += 1
  esle:
    break
print(i-1)


### FIXED CODE ###

x, y, z = map(int, input().split())
i = 0
while x - y*i - z*(i+1) >= 0:
    i += 1
print(i-1)
def func(a):
    if (a==1):
        return 0
    else:
        return func(a-1)+a
N=int(input())

S=10**9+7
if N==1:
    z=0
elif N==2:
    z=2
else:
    z=((10**(N-2) *N*2) - (10**(N-3) * ((6+func(N-2))))) %S
print(z)



### FIXED CODE ###

N=int(input())
MOD=10**9+7
if N==1:
    z=0
else:
    z = 10**N - (9**N *2) + 8**N
    z %= MOD
print(z)
n,a,b = list(map(int, input().split()))
m = (10 ** 9) + 7
dp = [-1] * (n+1)
total = 0

for i in range(0, n+1):
    if(i > 0):
        x = i * dp[i - 1]

        if(x <= m):
            dp[i] = x
        else:
            dp[i] = x % m
    else:
        dp[0] = 1

if n > 2:
    for i in range(1, n+1):
        if(i != a and i != b):
            total += int(dp[n] / (dp[i] * dp[n-i]))
    
print(total % m)


### FIXED CODE ###

n, a, b = list(map(int, input().split()))
p = (10 ** 9) + 7

def powmod(x, exp, mod):
    if(exp == 1):
        return x % mod

    if(exp % 2 == 1):
        return (x * powmod(x, exp - 1, mod)) % mod

    x = powmod(x, exp / 2, mod)

    return (x * x) % mod

# nCrを計算するが、nもrも巨大なためフェルマーの小定理を利用する
# x = nPr
# y = r!
# x / y ≡ x * y^-1
# p を法とした時、掛けるたびにmodをとった数同士の割り算はうまくいかない
# フェルマーの小定理から
# y^(p-1) ≡ 1
# y * y^(p-2) ≡ 1
# y^(p-2)がyの逆元と同じ振る舞いをするのでy^(p-2)を掛ける
def combination(n, r, mod):
    x = 1
    y = 1

    for i in range(r):
        x *= n - i # n * (n - 1) * (n - 2) * ... * (n - i + 1)
        x %= mod
        y *= i + 1 # r * (r - 1) * (r - 2) * ... * 2 * 1 を逆さまにかけていく
        y %= mod

    return x * powmod(y, mod - 2, mod) % mod


total = powmod(2, n, p) - 1 #1本も花を選ばないパターンは除外する
comb_a = combination(n, a, p)
comb_b = combination(n, b, p)


print((total - comb_a - comb_b) % p)
AC, BC, MC = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

M = [[0 for _ in range(AC)] for __ in range(BC)]
for i in range(MC):
    x, y, c = map(int, input().split())
    M[x-1][y-1] = max(M[x-1][y-1], c)

ans = 10**8
for a in range(AC):
    for b in range(BC):
        ans = min(ans, A[a-1] + B[b-1] - M[a-1][b-1])
print(ans)

### FIXED CODE ###

AC, BC, MC = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
M = [tuple(map(int, input().split())) for _ in range(MC)]

ans = min(A) + min(B)
for x, y, c in M:
    ans = min(ans, A[x - 1] + B[y - 1] - c)
print(ans)
A, B, K = map(int, input().split())

cand = []
for i in range(101,1,-1):
  if A%i == 0 and B%i == 0:
    cand += [i]
    
    
print(cand[K-1])

### FIXED CODE ###

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

cand = []
for i in range(100,0,-1):
  if A%i == 0 and B%i == 0:
    cand += [i]
    
    
print(cand[K-1])
N,T = map(int,input().split())
T = list(map(int,input().split()))
tot = 0
for i in range(1,N):
    d = T[i]-T[i-1]
    if d>T:
        tot += T
    else:
        tot += d
print(tot)

### FIXED CODE ###

N,T = map(int,input().split())
A = list(map(int,input().split()))
tot = 0
for i in range(1,N):
    d = A[i]-A[i-1]
    if d>T:
        tot += T
    else:
        tot += d
print(tot+T)
N = int(input())
    print(int((N / 2) + 0.9))

### FIXED CODE ###

N = int(input())
print(int((N / 2) + 0.9))
import math
a,b,x = map(int,input().split())
v = a **2 * b
h = 0
ans = 0
if v == x:
    ans = 0
if(x > v // 2):
    ans = 90 - math.degrees(math.atan(a ** 3 / ( 2 * (v - x))))
else:
    ans = 90 - math.degrees(math.atan(x / (a * b **2 // 2)))
print(ans)

### FIXED CODE ###

import math
a,b,x = map(int,input().split())
v = a **2 * b
h = 0
ans = 0
if v == x:
    ans = 0
elif(x > v // 2):
    ans = 90 - math.degrees(math.atan(a ** 3 / ( 2 * (v - x))))
else:
    ans = 90 - math.degrees(math.atan(x / (a * b **2 // 2)))
print(ans)
import math
import string
import collections
from collections import Counter
from collections import deque
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

N, M = map(int, input().split())
a = []
for _ in range(M):
    a.append(int(input()))

safe = [True]*(N+1)
for i in range(M):
    safe[(a[i])] = False

# print(a)
dp = [0]*(2*N)
#print('safe', safe)
dp[0] = 1
for i in range(0, N):
    if safe[i]:
        dp[i+1] = dp[i+1]+dp[i]
        dp[i+2] = dp[i+2]+dp[i]

    if not(safe[i]):
        dp[i] = 0
#print('dp', dp)
print(dp[N] % 1000000007)


### FIXED CODE ###

import math
import string
import collections
from collections import Counter
from collections import deque


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

N, M = map(int, input().split())
a = []
for _ in range(M):
    a.append(int(input()))
# print(a)
dp = [0]*(N+1)
#dp[0] = 1
#dp[1] = 1
# for i in range(2, N):
#    dp[i] = dp[i-1]+dp[i-2]
safe = [True]*(N+1)
for i in range(M):
    safe[(a[i])] = False
#print('safe', safe)
dp[0] = 1
if safe[1]:
    dp[1] = 1
for i in range(2, N+1):
    if safe[i]:
        dp[i] = dp[i-1]+dp[i-2]
    if not(safe[i]):
        dp[i] = 0
#print('dp', dp)
print(dp[N] % 1000000007)
n,k=map(int,input().split())
x=list(map(int,input().split()))
from bisect import bisect_left as bl

x0=bl(x,0)
if x[x0]==0:
    k-=1
    a=x[:x0]
    a=a[::-1]
    a=list(map(lambda x:-x,a))
    b=x[x0:]
else:
    a=x[:x0]
    a=a[::-1]
    a=list(map(lambda x:-x,a))
    b=x[x0:]
#print(a,b)
ans=float("INF")
if k<len(a):
    ans=min(ans,a[k-1])
if k<len(b):
    ans=min(ans,b[k-1])
for i in range(k):
    j=k-i-2
    if i<len(a) and 0<=j and j<len(b):
        ans2=2*a[i]+b[j]
        ans=min(ans,ans2)
        #print(i,j,ans)
for i in range(k):
    j=k-i-2
    if i<len(b) and 0<=j and j<len(a):
        ans2=b[i]+2*a[j]
        ans=min(ans,ans2)
        #print(i,j,ans)
print(ans)


### FIXED CODE ###

n,k=map(int,input().split())
x=[0]
for xi in input().split():
    xi=int(xi)
    if xi==0:
        k-=1
    else:
        x.append(xi)
x.sort()
ans=float("INF")
zero=x.index(0)
for i in range(max(0,zero-k-1),min(zero+1,n-k+1)):
    if x[i+k]<0 or x[i]>0:
        continue
    jogen=abs(x[i+k])
    kagen=abs(x[i])
    ans=min(ans,jogen*2+kagen,kagen*2+jogen)
print(ans)
s = input()
ans = 'No'
c = s.find('C')
if c != -1:
	f = s.find('F', c)
    if f != -1:
      ans = 'Yes'
print(ans)

 

### FIXED CODE ###

s = input()
ans = 'No'
c = s.find('C')
if c != -1:
  f = s[c:].find('F')
  if f != -1:
    ans = 'Yes'
print(ans)
A,B,C = map(int,input().split())
if A+B+C == 17 and (A==5 or A==7) and (B==5 or B==7) and (C==5 or C==7):
  print('YES')
  else:
    print('NO')

### FIXED CODE ###

A,B,C = map(int,input().split())
if A+B+C == 17 and (A==5 or A==7) and (B==5 or B==7) and (C==5 or C==7):
  print('YES')
else:
    print('NO')
n = int (input())
a = [input() for _ in range(n)]
if ( a(i) != a(i+1) ):
  print('Yes')
else:
  print('No')


### FIXED CODE ###

n = int(input())
a = set(map(int, input().split()))
ans = "YES"
if len(a) != n: #setは重複させないから。
  ans = "NO"
  
print(ans)
import bisect
import sys
input = sys.stdin.readline()

n = int(input())

a, b = map(int, input().split())
task_lis = [[b, a]]

for i in range(n-1):
    a, b = map(int, input().split())
    bisect.insort_right(task_lis,[b, a])

sum_a = 0
ch_over = 1

for i in range(n):
    sum_a += task_lis[i][1]
    if task_lis[i][0] < sum_a:
        ch_over = 0
        break

if ch_over == 0:
    print("No")
else:
    print("Yes")


### FIXED CODE ###

n = int(input())
task_lis = sorted([[int(i) for i in input().split()] for _ in range(n)], key = lambda x:x[1])


sum_a = 0
ch_over = 1

for i in range(n):
    sum_a += task_lis[i][0]
    if task_lis[i][1] < sum_a:
        ch_over = 0
        break

if ch_over == 0:
    print("No")
else:
    print("Yes")