CodeEff/ECCO huggingface dataset:
# Original solution
n, m = list(map(int,input().split()))
a = [int(eval(input())) for i in range(m)]
dp = [float("inf")] * (n+1)
dp[0] = 1
dp[1] = 1
for i in a:
    dp[i] = 0
for i in range(2, n+1):
    dp[i] = min(dp[i], (dp[i-1] + dp[i-2]))
print((dp[n] % 1000000007))

# Optimized solution
n, m = list(map(int,input().split()))
a = [int(eval(input())) for i in range(m)]
dp = [float("inf")] * (n+1)
dp[0] = 1
dp[1] = 1
for i in a:
    dp[i] = 0
for i in range(2, n+1):
    dp[i] = min(dp[i], (dp[i-1] + dp[i-2])%(10**9+7))
print((dp[n]))
# Original solution
n,m = list(map(int,input().split()))
xx = [int(eval(input())) for _ in range(m)]

f = [0]*(n+3)
f[0] = 1
endf = 0
for i in range(1,n+1):
    if i in xx:
        endf += 1
        if endf ==2:
            print((0))
            break
        continue
    else :
        if endf == 1:
            endf = 0
            f[i] = f[i-2]
        else :
            endf = 0
            f[i] = f[i-1] + f[i-2]
else:
    print((f[n]%1000000007))

# Optimized solution
n,m = list(map(int,input().split()))
mod = 10**9+7
dp = [1]*(n+1)
for i in range(m):
    dp[int(eval(input()))] =0

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

print((dp[n]%mod))
# Original solution
n, m = list(map(int, input().split()))
a_l = [ int(eval(input())) for _ in range(m) ]

dp = [0] * (n+1)
dp[0] = 1
if 1 not in a_l:
    dp[1] = 1
else:
    dp[1] = 0
if n > 1:
    if 2 not in a_l:
        dp[2] = dp[0] + dp[1]
    else:
        dp[2] = 0
    for i in range(2,n+1):
        if i not in a_l:
            dp[i] = (dp[i-1] + dp[i-2])%1000000007
        else:
            dp[i] = 0
print((dp[-1]))

# Optimized solution
n, m = list(map(int, input().split()))
a_l = [ int(eval(input())) for _ in range(m) ]

dp = [1] * (n+1)
dp[0] = 1
if 1 not in a_l:
    dp[1] = 1
else:
    dp[1] = 0
if n > 1:
    for i in a_l:
        dp[i] = 0
    if 2 not in a_l:
        dp[2] = dp[0] + dp[1]
    else:
        dp[2] = 0
    for i in range(2,n+1):
        if dp[i] != 0:
            dp[i] = (dp[i-1] + dp[i-2])%1000000007
print((dp[-1]))
# Original solution
n, m = list(map(int, input().split()))
a = [int(eval(input())) for i in range(m)]
s = [1] * (n + 1)
if 1 in a:
    s[1] = 0
for i in range(2, n + 1):
    if i in a:
        s[i] = 0
    else:
        if s[i - 2] == 0 and s[i - 1] == 0:
            print((0))
            exit()
        else:
            s[i] = s[i - 1] + s[i - 2]   
print((s[n] % 1000000007))

# Optimized solution
n, m = list(map(int, input().split()))
s = [1] * (n + 1)
for i in range(m):
    a = int(eval(input()))
    s[a] = 0
for i in range(2, n + 1):
    if s[i] == 0:
        continue
    else:
        if s[i - 2] == 0 and s[i - 1] == 0:
            print((0))
            exit()
        else:
            s[i] = s[i - 1] + s[i - 2]   
print((s[n] % 1000000007))
# Original solution
import math

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

def comb(n, r):
    return perm(n, r) // math.factorial(r)


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

A = [int(eval(input())) for _ in range(m)]
for i in range(m - 1):
    if A[i + 1] - A[i] == 1:
        ans = 0
        print(ans)
        exit()

S = []
for a in A:
    S.extend((a - 1, a, a + 1))
S.insert(0, 0)
S.append(n)

ans = 1
for i in range(len(S) - 1):
    r = S[i + 1] - S[i]
    if r > 1:
        c = 0
        t_max = r // 2
        for t in range(t_max + 1):
            c += comb(r - t, t)
        ans *= c

ans %= 10**9 + 7
print(ans)


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

S = [1] * (n + 1)
for _ in range(m):
    a = int(eval(input()))
    S[a] = 0

i = -3
for _ in range(n - 1):
    if S[i] != 0:
        S[i] = S[i + 1] + S[i + 2]
    i -= 1

ans = S[0] % (10**9 + 7)
print(ans)
# Original solution
read = input 
rn = lambda :list(map(int, read().split()))
n, m  = rn()
M = []
P = 1000000007
for i in range(m):
    M.append(int(read()))
M = set(M)
dp = [0 for i in range(n + 1000)]
dp[0] = 1
for i in range(n+1):
    for nxt in range(i+1, i+3):
        if(nxt not in M):
            dp[nxt] += dp[i]
            dp[nxt] %= P
print((dp[n]))

# Optimized solution
read = input 
rn = lambda :list(map(int, read().split()))
n, m  = rn()
M = []
P = 1000000007
for i in range(m):
    M.append(int(read()))
M = set(M)
dp = [0 for i in range(n + 10)]
dp[0] = 1
for i in range(n+1):
    for nxt in range(i+1, i+3):
        if(nxt not in M):
            dp[nxt] += dp[i]
            dp[nxt] %= P
print((dp[n]))
# Original solution
import sys

N, M = list(map(int, sys.stdin.readline().strip().split()))
A = set()
for _ in range(M):
    A.add(int(sys.stdin.readline()))

# i段目の階段への到達方法の数
dp = [0 for _ in range(N+1)]
dp[0] = 1
dp[1] = 0 if 1 in A else 1

for i in range(2, N+1):
    if i in A:
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] %= 1000000007

print((dp[N]))

# Optimized solution
import sys

mod = 1000000007

N, M = list(map(int, sys.stdin.readline().split()))
A = set()
for _ in range(M):
    a = int(sys.stdin.readline())
    A.add(a)

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

# print(dp)
print((dp[N]))
# Original solution
N,M=list(map(int,input().split()))
MOD=(10**9)+7
a=[0 for i in range(N+1)]
for _ in range(M):
  A=int(eval(input()))
  a[A]=-1
a[0]=1

for i in range(N):
  if a[i]==-1:
    continue
  if a[i+1]!=-1:
    a[i+1]+=a[i]
    a[i+1]%=MOD
  if i+2<=N and a[i+2]!=-1:
    a[i+2]+=a[i]
    a[i+2]%=MOD
print((a[N]))

# Optimized solution
N,M=list(map(int,input().split()))
MOD=(10**9)+7
a=[0 for i in range(N+1)]
for _ in range(M):
  A=int(eval(input()))
  a[A]=-1
a[0]=1

for i in range(N):
  if a[i]==-1:
    continue
  if a[i+1]!=-1:
    a[i+1]+=a[i]
    a[i+1]%=MOD
  if i+2<=N and a[i+2]!=-1:
    a[i+2]+=a[i]
    a[i+2]%=MOD
print((max(0,a[N])))
# Original solution
n,m = list(map(int,input().split()))
dp = [0]*(n+1)
ary = [int(eval(input())) for _ in range(m)]
dp[0] = 1
for i in ary:
    dp[i] = -1
    if dp[i-1] == -1 and dp[i] == -1:print((0));exit()
for i in range(1,n+1):
    if dp[i] == -1:continue
    elif dp[i-1] == -1:dp[i] = dp[i-2]
    elif dp[i-2] == -1:dp[i] = dp[i-1]
    elif i > 1: dp[i] = dp[i-1]+dp[i-2]
    else: dp[i] = dp[i-1]
print((dp[n]%(10**9+7)))

# Optimized solution
import sys
sys.setrecursionlimit(500000)

def f(i):
    if dp[i] != -1 and dp[i] != 0: return dp[i]
    if dp[i] == -1: return 0

    if i == -1:
        return f(i - 1)
    elif i > 1:
        dp[i] = f(i - 1) + f(i - 2)
    else:
        dp[i] = f(i - 1)
    return dp[i]

n,m = list(map(int,input().split()))
dp = [0]*(n+1)
ary = [int(eval(input())) for _ in range(m)]
dp[0] = 1
for i in ary:
    dp[i] = -1
    if dp[i-1] == -1 and dp[i] == -1:print((0));exit()
print((f(n)%(10**9+7)))
# Original solution
import sys
sys.setrecursionlimit(500000)

def f(i):
    if dp[i] != -1 and dp[i] != 0: return dp[i]
    if dp[i] == -1: return 0

    if i == -1:
        return f(i - 1)
    elif i > 1:
        dp[i] = f(i - 1) + f(i - 2)
    else:
        dp[i] = f(i - 1)
    return dp[i]

n,m = list(map(int,input().split()))
dp = [0]*(n+1)
ary = [int(eval(input())) for _ in range(m)]
dp[0] = 1
for i in ary:
    dp[i] = -1
    if dp[i-1] == -1 and dp[i] == -1:print((0));exit()
print((f(n)%(10**9+7)))


# Optimized solution
n,m = list(map(int,input().split()))
dp = [0]*(n+1)
for i in range(m):
    x = int(eval(input()))
    dp[x] = -1
dp[0] = 1
for i in range(1,n+1):
    if dp[i] == -1:continue
    elif dp[i-1] == -1:dp[i] = dp[i-2]
    elif dp[i-2] == -1:dp[i] = dp[i-1]
    elif i > 1:
        dp[i] = dp[i-2]+dp[i-1]
    else:dp[i] = dp[i-1]
print((dp[n]%(10**9+7) if dp[n] != -1 else 0))
# Original solution
n, m = list(map(int, input().split(' ')))
arr  = set()
for _ in range(m):
    x = int(eval(input()))
    arr.add(x)


MOD = int(1e9) + 7

w = [0 for _ in range(n + 1)]
w[0] = 1
for i in range(1, n+1):
    if i in arr:
        continue

    if i - 1 >= 0 and i - 1 not in arr:
        w[i] += w[i-1]

    if i - 2 >= 0 and i - 2 not in arr:
        w[i] += w[i-2]
    
    w[i] %= MOD


# print(w)
print((w[n]))


# Optimized solution
n, m = list(map(int, input().split(' ')))
arr  = set()
for _ in range(m):
    x = int(eval(input()))
    arr.add(x)

MOD = int(1e9) + 7

w = [0 for _ in range(n + 1)]

if 0 not in arr:
    w[0] = 1

for i in range(n + 1):
    if i in arr:
        continue

    if i - 1 >= 0 and i - 1 not in arr:
        w[i] += w[i-1]

    if i - 2 >= 0 and i - 2 not in arr:
        w[i] += w[i-2]
    
    w[i] %= MOD


print((w[n]))
# Original solution
mod=10**9+7
n,m=list(map(int,input().split()))
dp=[0]*(n+1)
dp[0]=1
a=[int(eval(input())) for _ in range(m)]

if 0 in a:
    print((0))
    exit()
for i in range(n):
    if i+1 not    in a:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if i+2<=n and i+2 not  in a:
        dp[i+2]+=dp[i]
        dp[i+1]%=mod
print((dp[-1]%mod))

# Optimized solution
N,M = list(map(int,input().split()))
A = set([int(eval(input())) for i in range(M)])
MOD = 10**9+7

if 0 in A:
    print((0))
    exit()

dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print((dp[-1]))
# Original solution
N,M = list(map(int,input().split()))
A = set([int(eval(input())) for i in range(M)])
MOD = 10**9+7

if 0 in A:
    print((0))
    exit()

dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print((dp[-1]))


# Optimized solution
N,M = list(map(int,input().split()))
A = set([int(eval(input())) for i in range(M)])
MOD = 10**9+7



dp = [0]*(N+1)
dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i+1] %= MOD
    if i+2 <= N and i+2 not in A:
        dp[i+2] += dp[i]
        dp[i+2] %= MOD
print((dp[-1]%MOD))
# Original solution
N,M=list(map(int,input().split()))
a=list(int(eval(input())) for _ in range(M) )
ans=0
ansn1=0
ansn2=0
mod=1000000007
for i in range(N):

    if i>=2 and  i+1 not in a:
        ans=(ansn1+ansn2)%mod
        ansn2 = ansn1
        ansn1=ans
        continue

    elif i+1 in a:
        ans = 0
        ansn2 = ansn1
        ansn1 = ans
        continue


    if i==0:
        if i+1 not in a:
            ans=1
            ansn2 = 0
            ansn1=ans

    elif i==1:
        if i+1 not in a:
            ans=1+ansn1
            ansn2 = ansn1
            ansn1=ans
        else:
            ans=0
            ansn2=ansn1
            ansn1=ans


print(ans)


# Optimized solution
N,M=list(map(int,input().split()))
a=list(int(eval(input()))for _ in range(M))
L=[1 for i in range(N+1)]
dp=[0 for _ in range(N+1)]
#L[0]=0
dp[0]=1
mod=1000000007
for j in a:
    L[j]=0
for i in range(1,N+1):
    if i>=2:
        dp[i]=(dp[i-1]*L[i-1]+dp[i-2]*L[i-2])*L[i]

    elif i==1:
        dp[i]=1
    dp[i]%=mod

print((dp[N]))
# Original solution
n, m = list(map(int, input().split()))

a_list=[]

for index in range(m):
    a_list.append(int(eval(input())))

ans_list=[]

for index in range(n + 1):
    ans_list.append(0)

for index in range(n + 1):
    if index == 0:
        ans_list[index] += 1
        continue
    if index == 1 and (index not in a_list):
        ans_list[index] += ans_list[index - 1]
        continue
    
    if index not in a_list:
        if (index - 1) not in a_list:
            ans_list[index] += ans_list[index - 1]
            ans_list[index] %= 1000000007
        if (index - 2) not in a_list:
            ans_list[index] += ans_list[index - 2]
            ans_list[index] %= 1000000007

print((ans_list[n]))


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

a_set=set()

for index in range(m):
    a_set.add(int(eval(input())))

ans_list=[]

for index in range(n + 1):
    ans_list.append(0)

for index in range(n + 1):
    if index == 0:
        ans_list[index] += 1
        continue
    if index == 1 and (index not in a_set):
        ans_list[index] += ans_list[index - 1]
        continue
    
    if index not in a_set:
        if (index - 1) not in a_set:
            ans_list[index] += ans_list[index - 1]
            ans_list[index] %= 1000000007
        if (index - 2) not in a_set:
            ans_list[index] += ans_list[index - 2]
            ans_list[index] %= 1000000007

print((ans_list[n]))
# Original solution
import sys
input = sys.stdin.readline

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

a_list = []

for index in range(m):
    a_list.append(int(eval(input())))

ans_list = []

ans_list = [0] * (n + 1)

for index in range(n + 1):
    if index == 0:
        ans_list[index] += 1
        continue
    if index == 1 and (index not in a_list):
        ans_list[index] += ans_list[index - 1]
        continue

    if index not in a_list:
        if (index - 1) not in a_list:
            ans_list[index] += ans_list[index - 1]
            ans_list[index] %= 1000000007
        if (index - 2) not in a_list:
            ans_list[index] += ans_list[index - 2]
            ans_list[index] %= 1000000007

print((ans_list[n]))


# Optimized solution
import sys
input = sys.stdin.readline

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

a_set = {int(eval(input())) for _ in range(m)}

ans_list = []

ans_list = [0] * (n + 1)

for index in range(n + 1):
    if index == 0:
        ans_list[index] += 1
        continue
    if index == 1 and (index not in a_set):
        ans_list[index] += ans_list[index - 1]
        continue

    if index not in a_set:
        if (index - 1) not in a_set:
            ans_list[index] += ans_list[index - 1]
            ans_list[index] %= 1000000007
        if (index - 2) not in a_set:
            ans_list[index] += ans_list[index - 2]
            ans_list[index] %= 1000000007

print((ans_list[n]))
# Original solution
import sys
input = sys.stdin.readline

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

a_set = {int(eval(input())) for _ in range(m)}

ans_list = []

ans_list = [0] * (n + 1)

for index in range(n + 1):
    if index == 0:
        ans_list[index] += 1
        continue
    if index == 1 and (index not in a_set):
        ans_list[index] += ans_list[index - 1]
        continue

    if index not in a_set:
        if (index - 1) not in a_set:
            ans_list[index] += ans_list[index - 1]
            ans_list[index] %= 1000000007
        if (index - 2) not in a_set:
            ans_list[index] += ans_list[index - 2]
            ans_list[index] %= 1000000007

print((ans_list[n]))


# Optimized solution
import sys

input = sys.stdin.readline

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

a = {int(eval(input())) for _ in range(m)}

count = 0

stair = [0] * (n + 1)

for index, value in enumerate(stair):
    if index == 0:
        stair[index] = 1
        continue
    if index == 1:
        if index - 1 not in a:
            stair[index] += stair[index-1]
        continue

    if index - 1 not in a:
        stair[index] += stair[index - 1]
        stair[index] %= 1000000007
    if index - 2 not in a:
        stair[index] += stair[index - 2]
        stair[index] %= 1000000007

print((stair[len(stair) - 1]))
# Original solution
mod = 10**9+7
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]

dp = [0] * (N + 1)
dp[:2] = 1, 1 if 1 not in a else 0

for i in range(2, N+1):
    if not i in a:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print((dp[-1]))


# Optimized solution
mod = 10**9+7
N, M = list(map(int, input().split()))
a = set(int(eval(input())) for _ in range(M))

dp = [0] * (N + 1)
dp[:2] = 1, 1 if 1 not in a else 0

for i in range(2, N+1):
    # in listでは間に合わない
    if not i in a:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print((dp[-1]))
# Original solution
n,m = list(map(int,input().split()))
a = [int(eval(input())) for _ in range(m)]
dp = [0] * (n + 1)
dp[0] = 1
mod = 10**9+7
for i in range(1,n+1):
    if i in a:
        dp[i] = 0
    elif i == 1:
        dp[i] = 1
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print((dp[-1]))

# Optimized solution
n,m = list(map(int,input().split()))
a = set([int(eval(input())) for _ in range(m)])
dp = [0] * (n + 1)
dp[0] = 1
mod = 10**9+7
for i in range(1,n+1):
    if i in a:
        dp[i] = 0
    elif i == 1:
        dp[i] = 1
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print((dp[-1]))
# Original solution
n,m = list(map(int,input().split()))
a = set([int(eval(input())) for _ in range(m)])
dp = [0] * (n + 1)
dp[0] = 1
mod = 10**9+7
for i in range(1,n+1):
    if i in a:
        dp[i] = 0
    elif i == 1:
        dp[i] = 1
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print((dp[-1]))

# Optimized solution
n,m = list(map(int,input().split()))
a = set([int(eval(input())) for _ in range(m)])
mod = 10 ** 9 + 7
dp = [float("inf")] * (n+1)
dp[0] = 1
for i in range(1,n+1):
    if i in a:
        dp[i] = 0
    elif i < 2:
        dp[i] = i
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod
print((dp[-1]))
# Original solution
n, m = list(map(int,input().split()))
a = [int(eval(input())) for i in range(m)]

p,q=(0,1)
#累積和っぽい考え
for i in range(1, n+1):
	p,q = q,(p+q)*(not i in a)
print((q%(10**9+7)))

# Optimized solution
n, m = list(map(int,input().split()))
a = set([int(eval(input())) for i in range(m)])

p,q=(0,1)
#累積和っぽい考え
for i in range(1, n+1):
	p,q = q,(p+q)*(not i in a)
print((q%(10**9+7)))
# Original solution
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]

dp = [0] * (N + 1)
dp[0] = 1

for i in range(-1, N - 1):
    if i + 2 in A:
        dp[i + 2] = 0
    elif i + 2 == 1:
        dp[i + 2] = dp[i + 1]
    else:
        dp[i + 2] = (dp[i + 1] + dp[i]) % (10 ** 9 + 7)
        
print((dp[-1]))

# Optimized solution
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]

B = [-1] + A + [N + 1]
B = [B[i + 1] - B[i] - 2 for i in range(M + 1)]

total = max(B)
dp = [1, 1] + [0] * (total - 1)
for i in range(total - 1):
    dp[i + 2] = (dp[i + 1] + dp[i]) % (10 ** 9 + 7)
        
ans = 1
for i in range(M + 1):
    ans *= dp[B[i]]
    ans %= 10 ** 9 + 7
print((ans if -1 not in B[1:] else 0))
# Original solution
n, m = list(map(int, input().split()))
a = [0]*m
for _ in range(m):
    a[_] = int(eval(input())) 
s = [1]*(n+1)

if 1 in a:
    s[1] = 0

for i in range(2,n+1):
    if i in a:
        s[i] = 0
        continue
    s[i] = (s[i-1] + s[i-2]) % (10**9+7)

print((s[-1]))

# Optimized solution
n, m = list(map(int, input().split()))
a = set([int(eval(input())) for _ in range(m)])

s = [1]*(n+1)

if 1 in a:
    s[1] = 0

for i in range(n-1):
    if i+2 in a:
        s[i+2] = 0
        continue
    s[i+2] = (s[i+1] + s[i]) % (10**9+7)
    
print((s[-1]))
# Original solution
N,M=(int(x) for x in input().split())
a=[int(eval(input())) for i in range(M)]

x=[0]*(N+1)
if len(x)!=0:
    x[0]=1
if len(x) >0:
    x[1]=1 if not 1 in a else 0

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

print((int(x[N]%(1000000007))))

# Optimized solution
N,M=(int(x) for x in input().split())
a=[int(eval(input())) for i in range(M)]

x=[0]*(N+1)
j=0
if N!=0:
    x[0]=1
if N>1 and M!= 0 and a[0]==1:
    j+=1
else:
    x[1]=1

for i in range(2,N+1): 
    if j==M or i!=a[j]:
        x[i]=x[i-1]+x[i-2]
    else:
        x[i]=0
        j+=1
print((int(x[N]%(1000000007))))
# Original solution
n, m = list(map(int, input().split()))
mod = 1000000007
a = [True] * (n + 1)
for i in range(m):
    a[int(eval(input()))] = False
dp = [0] * (n + 1)
dp[0] = 1

dp[1] = dp[0] if a[1] else 0

for i in range(2, n + 1):
    if a[i]:
        dp[i] = (dp[i - 1] + dp[i - 2]) % mod

print((dp[n]))


# Optimized solution
import sys
n, m = list(map(int,input().split()))
mod = 1000000007
a = [True] * (n + 1)
for i in range(m):
    a[int(sys.stdin.readline())] = False
dp = [0] * (n + 1)
dp[0] = 1

dp[1] = dp[0] if a[1] else 0

for i in range(2, n + 1):
    if a[i]:
        dp[i] = (dp[i - 1] + dp[i - 2]) % mod

print((dp[n]))
# Original solution
N, M = list(map(int, input().split()))
A = []
for i in range(M):
  A.append(int(eval(input())))

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

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

print((dp[N]%div))


# Optimized solution
N, M = list(map(int, input().split()))
A = []
for i in range(M):
  A.append(int(eval(input())))

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

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

print((dp[N]%mod))
# Original solution
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
MOD = 10**9+7

n, m = list(map(int, readline().split()))
a = list(map(int, read().split()))

dp = [0] * (n + 1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
cnt = 0
for i in range(2, n + 1):
    if i not in a:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
        cnt = 0
    else:
        cnt += 1
        if cnt == 2:
            print('0')
            exit()
print((dp[n]))


# Optimized solution
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
MOD = 10**9+7

n, m = list(map(int, readline().split()))
a = set(map(int, read().split()))

dp = [0] * (n + 1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
cnt = 0
for i in range(2, n + 1):
    if i not in a:
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
        cnt = 0
    else:
        cnt += 1
        if cnt == 2:
            print('0')
            exit()
print((dp[n]))
# Original solution
N, M = list(map(int, input().split()))
lst_a = [int(eval(input())) for _ in range(M)]
MOD = 10**9 + 7

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

print(ans)

# Optimized solution
N, M = list(map(int, input().split()))
set_a = set([int(eval(input())) for _ in range(M)])
MOD = 10**9 + 7

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

print(ans)
# Original solution
import sys
input=sys.stdin.readline
def main():
  n,m=list(map(int,input().split()))
  a=tuple(int(eval(input())) for _ in range(m))
  mod=10**9+7
  pattern=[0]*(n+1)
  pattern[0]=pattern[1]=1
  if 1 in a:
      pattern[1]=0
  for i in range(2,n+1):
      if i in a:
          pattern[i]=0
      else:
          pattern[i]=(pattern[i-1]+pattern[i-2])%mod
  print((pattern[n]))
main()

# Optimized solution
import sys
input=sys.stdin.readline
def main():
  n,m=list(map(int,input().split()))
  a=tuple(int(eval(input())) for _ in range(m))
  a=set(a)
  mod=10**9+7
  pattern=[0]*(n+1)
  pattern[0]=pattern[1]=1
  if 1 in a:
      pattern[1]=0
  for i in range(2,n+1):
      if i in a:
          pattern[i]=0
      else:
          pattern[i]=(pattern[i-1]+pattern[i-2])%mod
  print((pattern[n]))
main()
# Original solution
import sys
sys.setrecursionlimit(10 ** 6)

n, m = [int(i) for i in input().split()]
fibo_l = [1] + [0] * n
a = [int(eval(input())) for i in range(m)]
for i in a:
    fibo_l[i] = None

def fibo(x):
    if x >= 0 and fibo_l[x] is not None:
        if fibo_l[x] == 0:
            fibo_l[x] = fibo(x-1) % 1000000007 + fibo(x-2) % 1000000007
        return fibo_l[x]
    else: return 0

print((fibo(n) % 1000000007))


# Optimized solution
import sys
sys.setrecursionlimit(10 ** 6)

n, m = [int(i) for i in input().split()]
fibo_l = [1] + [None] * n
a = set([int(eval(input())) for i in range(m)])

def fibo(x):
    if x not in a and x >= 0:
            if fibo_l[x] is None:
                fibo_l[x] = fibo(x-1) % 1000000007 + fibo(x-2) % 1000000007
            return fibo_l[x]
    else: return 0
    
print((fibo(n) % 1000000007))