CodeEff/ECCO huggingface dataset:
# Original solution
def slove():
    import sys
    input = sys.stdin.readline
    n, m = list(map(int, input().rstrip('\n').split()))
    a = [int(input().rstrip('\n')) for _ in range(m)]
    dp = [0] * (n + 1)
    dp[0] = 1 if 0 not in a else 0
    dp[1] = 1 if 1 not in a else 0
    for i in range(2, n + 1):
        if i not in a:
            dp[i] = (dp[i-1] + dp[i-2]) % (10 ** 9 + 7)
        else:
            dp[i] = 0
    print((dp[-1]))


if __name__ == '__main__':
    slove()


# Optimized solution
def slove():
    import sys
    input = sys.stdin.readline
    n, m = list(map(int, input().rstrip('\n').split()))
    a = dict([[int(input().rstrip('\n')), 0] for i in range(m)])
    dp = [0] * (n + 1)
    dp[0] = 1 if 0 not in a else 0
    dp[1] = 1 if 1 not in a else 0
    for i in range(2, n + 1):
        if i not in a:
            dp[i] = (dp[i-1] + dp[i-2]) % (10 ** 9 + 7)
        else:
            dp[i] = 0
    print((dp[-1]))


if __name__ == '__main__':
    slove()
# Original solution
def slove():
    import sys
    input = sys.stdin.readline
    n, m = list(map(int, input().rstrip('\n').split()))
    a = dict([[int(input().rstrip('\n')), 0] for _ in range(m)])
    x = [0] * (n + 1)
    x[0] = 1 if 0 not in a else 0
    x[1] = 1 if 1 not in a else 0
    for i in range(2, n+1):
        if i not in a:
            x[i] = (x[i-1] + x[i-2]) % 1000000007
        else:
            x[i] = 0
    print((x[-1]))


if __name__ == '__main__':
    slove()


# Optimized solution
def slove():
    import sys
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, input().rstrip('\n').split()))
    a = {int(input().rstrip('\n')): 0 for _ in range(m)}
    dp = [0] * (n + 1)
    dp[0] = 1 if 0 not in a else 0
    dp[1] = 1 if 1 not in a else 0
    for i in range(2, n + 1):
        if i not in a:
            dp[i] = (dp[i-1] + dp[i-2]) % mod
        else:
            dp[i] = 0
    print((dp[-1]))


if __name__ == '__main__':
    slove()
# Original solution
n, m = list(map(int, input().split()))
a = [ int(eval(input())) for _ in range(m) ]
dp = [0]*n
for i in range(n):
  if not i+1 in a:
    if i == 0:
      dp[i] = 1
    elif i == 1:
      dp[i] = 1 + dp[i-1]
    else:
      dp[i] = dp[i-2] + dp[i-1]
  if dp[i] >= 1000000007:
    dp[i] %= 1000000007
print((dp[n-1]%1000000007))

# Optimized solution
n, m = list(map(int, input().split()))
A = [ int(eval(input())) for _ in range(m) ]
dp = [0]*(n+1)
broken = [False]*(n+1)
for i in A:
  broken[i] = True
dp[0] = 1
if not broken[1]:
  dp[1] = 1
for i in range(2, n+1):
  if broken[i]:
    continue
  else:
    dp[i] = dp[i-2] + dp[i-1]

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

# Optimized solution
# -*- coding: utf-8 -*-
n,m=list(map(int,input().split()))
a=[]
mod=1000000007
for _ in range(m):
    a.append(int(eval(input())))
a=set(a)
ans=[1]+[0]*(n)
for i in range(1,n+1):
    if i in a:
        ans[i]=0
    else:
        ans[i]=(ans[i-1]+ans[i-2])%mod
print((ans[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 not in a:
    dp[1]=1
for i in range(2,N+1):
    if i in a:
        continue
    dp[i]=(dp[i-1]+dp[i-2])
print((dp[-1]%1000000007))    

# Optimized solution
N,M=list(map(int,input().split()))
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[-1]%1000000007))
# Original solution
N,M = list(map(int,input().split()))
A = [int(eval(input())) for m in range(M)]
dp = (N+1)*[0]
dp[0] = 1

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

print((dp[-1]))

# Optimized solution
N,M = list(map(int,input().split()))
A = set(int(eval(input())) for m in range(M))
dp = (N+1)*[0]
dp[0] = 1

for n in range(1,N+1):
  if n not in A:
    dp[n] = (dp[n-2]+dp[n-1])%(10**9+7)

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

# Optimized solution
N,M = list(map(int,input().split()))
A = []
MOD = 1000000007
for _ in range(M):
  a = int(eval(input()))
  A.append(a)
DP = [1]*(N+1)
for i in A:
  DP[i] = 0
for i in range(2,N+1):
  DP[i] = (DP[i-1]+DP[i-2])%MOD*DP[i]
print((DP[-1]))
# Original solution
N, M = list(map(int, input().split()))
aset = 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 aset else 1
for i in range(2, N + 1):
    if i not in aset:
        dp[i] = dp[i - 1] + dp[i - 2]
print((dp[-1] % MOD))


# Optimized solution
N, M = list(map(int, input().split()))
aset = set([int(eval(input())) for _ in range(M)])
dp = [0] * (N + 1)
dp[0] = 1
for i in range(N):
    for j in range(i + 1, min(N, i + 2) + 1):
        if j not in aset:
            dp[j] += dp[i]
            dp[j] %= 10**9 + 7
print((dp[N]))
# Original solution
N, M = list(map(int, input().split()))
aset = set([int(eval(input())) for _ in range(M)])
dp = [0] * (N + 1)
dp[0] = 1
for i in range(N):
    for j in range(i + 1, min(N, i + 2) + 1):
        if j not in aset:
            dp[j] += dp[i]
            dp[j] %= 10**9 + 7
print((dp[N]))


# Optimized solution
N, M = list(map(int, input().split()))
aset = set([int(eval(input())) for _ in range(M)])
dp = [0] * (N + 1)
dp[0] = 1
if 1 not in aset:
    dp[1] = 1
for i in range(2, N + 1):
    if i in aset:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % (10**9 + 7)
print((dp[-1]))
# Original solution
INF = 1_000_000_007


def comb(n, k):
    k = min(n - k, k)
    if n == 0 or k == 0:
        return 1
    a = n
    for i in range(n - 1, n - k, -1):
        a *= i
    b = 1
    for i in range(2, k + 1):
        b *= i
    return a // b


N, M = list(map(int, input().split()))
A = [-1] + [int(eval(input())) for _ in range(M)] + [N + 1]
res = 1
for i in range(M + 1):
    t = A[i + 1] - A[i] - 2
    if t < 0:
        res = 0
    else:
        _t = 0
        for i in range(t // 2 + 1):
            _t += comb(t - i, i)
        res *= _t
print((res % INF))


# Optimized solution
MOD = 10 ** 9 + 7
N, M = list(map(int, input().split()))
B = [True] * (N + 1)
D = [1] + [0] * N
for _ in range(M):
    a = int(eval(input()))
    B[a] = False
for i in range(N):
    for j in range(i + 1, min(N, i + 2) + 1):
        if B[j]:
            D[j] = (D[j] + D[i]) % MOD
print((D[N]))
# Original solution
import itertools

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

def count_step(n):
    num=n//2
    count=0
    for i in range(num+1):
        step=[]
        for _ in range(n-2*i):
            step.append(1)
        for _ in range(i):
            step.append(2)
        count+=len(list(itertools.combinations(step,i)))
    return count

if M!=0:
    a2=[a[0]-1]
    
    for i in range(M-1):
        p=a[i+1]-a[i]-2
        
        a2.append(p)
    
    a2.append(N-a[M-1]-1)

p=1
for i in range(M-1):
    if a[i]+1==a[i+1]:
        p=0
        break

if p==0:
    pattern=0
else:
    pattern=1
    if M==0:
        pattern=count_step(N)
    else:
        for i in range(len(a2)):
            pattern*=count_step(a2[i])

print((pattern%1000000007))

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

b=[]
num=0
if len(a)>1:
    b.append(a[1]-a[0]-1)
    for i in range(1,M):
            b.append(a[i+1]-a[i]-2)
    b.append(N-a[M]-1)
else:
    b.append(N)

num=max(b)


mod=1000000007

def fib(n,num):
    fib=[0 for i in range(num+10)]
    fib[0]=1
    fib[1]=1
    for i in range(2,num+1):
        fib[i]=fib[i-1]+fib[i-2]
    return fib[n]

if -1 in b:
    print((0))
else:
    p=1
    for j in range(M+1):
        p*=fib(b[j],num)
    print((p%mod))
# Original solution
from itertools import product

INF = 1000000007

def mat2_mul(X, Y):
	z = [[0, 0], [0, 0]]
	for (i, j, k) in product(list(range(2)), list(range(2)), list(range(2))):
		z[i][j] += X[i][k] * Y[k][j]
	return z

def mat2_pow(X, n):
	if n == 0:
		return [[1, 0], [0, 1]]
	elif n % 2:
		return mat2_mul(X, mat2_pow(X, n - 1))
	else:
		half_pow = mat2_pow(X, n / 2)
		return mat2_mul(half_pow, half_pow)

def fib(n):
	if n == 0:
		return 0
	else:
		f = [[0, 1], [1, 1]]
	return mat2_pow(f, n - 1)[1][1]


N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
ans, start = 1, 0
tmp = []

for i in range(len(a)):
	if a[i] - a[i - 1] == 1:
		print((0))
		exit()

for k in a:
	tmp.append(fib(k - start) % INF)
	start = k + 1

for j in tmp:
	ans *= j
	ans %= INF

ans *= fib(N - start + 1)
print((ans % INF))


# Optimized solution
from itertools import product

INF = 1000000007

def mat2_mul(X, Y):
	z = [[0, 0], [0, 0]]
	for (i, j, k) in product(list(range(2)), list(range(2)), list(range(2))):
		z[i][j] += X[i][k] * Y[k][j]
	return z

def mat2_pow(X, n):
	if n == 0:
		return [[1, 0], [0, 1]]
	elif n % 2:
		return mat2_mul(X, mat2_pow(X, n - 1))
	else:
		half_pow = mat2_pow(X, n / 2)
		return mat2_mul(half_pow, half_pow)

def fib(n):
	if n == 0:
		return 0
	else:
		f = [[0, 1], [1, 1]]
	return mat2_pow(f, n - 1)[1][1]


N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
ans, start = 1, 0
tmp = []

for i in range(len(a)):
	if a[i] - a[i - 1] == 1:
		print((0))
		exit()

for k in a:
	ans *= fib(k - start)
	ans %= INF
	start = k + 1

ans *= fib(N - start + 1)
print((ans % INF))
# Original solution
from itertools import product

INF = 1000000007

def mat2_mul(X, Y):
	z = [[0, 0], [0, 0]]
	for (i, j, k) in product(list(range(2)), list(range(2)), list(range(2))):
		z[i][j] += X[i][k] * Y[k][j]
	return z

def mat2_pow(X, n):
	if n == 0:
		return [[1, 0], [0, 1]]
	elif n % 2:
		return mat2_mul(X, mat2_pow(X, n - 1))
	else:
		half_pow = mat2_pow(X, n / 2)
		return mat2_mul(half_pow, half_pow)

def fib(n):
	if n == 0:
		return 0
	else:
		f = [[0, 1], [1, 1]]
	return mat2_pow(f, n - 1)[1][1]


N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
ans, start = 1, 0
tmp = []

for i in range(len(a)):
	if a[i] - a[i - 1] == 1:
		print((0))
		exit()

for k in a:
	ans *= fib(k - start)
	ans %= INF
	start = k + 1

ans *= fib(N - start + 1)
print((ans % INF))


# Optimized solution
from itertools import product

INF = 1000000007

def mat2_mul(X, Y):
	z = [[0, 0], [0, 0]]
	for (i, j, k) in product(list(range(2)), list(range(2)), list(range(2))):
		z[i][j] += X[i][k] * Y[k][j]
	return z

def mat2_pow(X, n):
	if n == 0:
		return [[1, 0], [0, 1]]
	elif n % 2:
		return mat2_mul(X, mat2_pow(X, n - 1))
	else:
		half_pow = mat2_pow(X, n / 2)
		return mat2_mul(half_pow, half_pow)

def fib(n):
	if n == 0:
		return 0
	else:
		f = [[0, 1], [1, 1]]
	return mat2_pow(f, n - 1)[1][1]


N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
ans, start = 1, 0
tmp = []

for k in a:
	ans *= fib(k - start)
	ans %= INF
	start = k + 1

ans *= fib(N - start + 1)
print((ans % INF))
# Original solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
INF = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, N + 1):
	if i in a:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF

print((dp[N]))


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

dp = [0] * (N + 1)
dp[0] = 1
if 1 not in a:
	dp[1] = 1
else:
	dp[1] = 0
for i in range(2, N + 1):
	if i in a:
		continue
	dp[i] = dp[i - 1] + dp[i - 2]
	dp[i] %= INF

print((dp[N]))
# Original solution
n,m=list(map(int,input().split()))
a=[]
for i in range(m):
  a_=int(eval(input()))
  a.append(a_)
  
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
    continue
  dp[i]=dp[i-1]+dp[i-2]
#print(dp)
print((dp[n]%(1000000007)))

# Optimized solution
n,m=list(map(int,input().split()))
a=[]
for i in range(m):
  a_=int(eval(input()))
  a.append(a_)
  
dp=[-1]*(n+1)
dp[0]=1
dp[1]=1
for i in a:
  dp[i]=0

for i in range(2,n+1):
  if dp[i]==-1:
    dp[i]=dp[i-1]+dp[i-2]
#print(dp)
print((dp[n]%(1000000007)))
# Original solution
import math
from collections import deque

memo = deque([1, 2])
floor = 1
def search(x):
    global memo, floor
    while x > floor:
        memo.append(memo[-1] + memo[-2])
        floor += 1
    return memo[x-1]

CONST = 1000000007
n,m = list(map(int,input().split()))
lis = []
prev = -1
for _ in range(m):
    a = int(eval(input()))
    if prev + 1 == a:
        print((0))
        exit()
    lis.append(a-prev-2)
    prev = a
lis.append(n-prev-1)


ans = 1
for v in lis:
    if v == 0: continue
    ans = (ans * search(v)) % CONST
print(ans)


# Optimized solution
from collections import deque

CONST = 1000000007

n,m = list(map(int,input().split()))
lis = deque([int(eval(input())) for _ in range(m)])
lis.append(n+1)
nhole = lis.popleft()

memo = deque([0, 1])
for i in range(1,n+1):
    if i == nhole:
        memo.append(0)
        nhole = lis.popleft()
    else:
        memo.append((memo[-1] + memo[-2])%CONST)
print((memo[-1]))
# Original solution
N,M=list(map(int,input().split()))
a=[int(eval(input())) for i in range(M)]
dp=[0]*(N+1)
dp[0]=1
dp[1]=0 if 1 in a else 1
mod=10**9+7

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

print((dp[N]))

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

for i in range(N+1):
    if a[i+1] != 1:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if a[i+2] != 1:
        dp[i+2]+=dp[i]
        dp[i+2]%=mod

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

for i in range(N+1):
    if a[i+1] != 1:
        dp[i+1]+=dp[i]
        dp[i+1]%=mod
    if a[i+2] != 1:
        dp[i+2]+=dp[i]
        dp[i+2]%=mod

print((dp[N]))

# Optimized solution
N,M=list(map(int,input().split()))
a=[int(eval(input())) for i in range(M)]
tf=[0]*(N+1)
for i in a:
  tf[i]=1
dp=[0]*(N+1)
dp[0]=1
dp[1]=0 if 1 in a else 1
mod=10**9+7
 
for i in range(2,N+1):
    if tf[i] == 1:
        continue
    else:
        dp[i]=(dp[i-1]+dp[i-2])%mod
 
print((dp[N]))
# Original solution
import sys

n,m = list(map(int,input().split()))
t = [0] * 2
t[0] = 1
t[1] = 2
a = []
for _ in range(m):
	a.append(int(eval(input())))
mod = 10**9 + 7

for i in range(1,m):
	if a[i] - a[i-1] == 1:
		print((0))
		sys.exit()
a.append(n+1)

l = []
dan = 0
for i in range(m+1):
	l.append(a[i]-1-dan)
	dan = a[i] + 1
	if dan == n+2:
		break

if max(l) > 2:
	for i in range(2,max(l)):
		t.append(t[i-1] + t[i-2])

ans = 1
for i in l:
	if i != 0 and t[i-1] != 0:
		ans *= t[i-1]
		ans %= mod

print(ans)


# Optimized solution
import sys

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

a = []
for _ in range(m):
    a.append(int(eval(input())))

if n == 1:
    print((1))
    sys.exit()
dp = [0 for _ in range(n+1)]
dp[0] = 1
dp[1] = 1
dp[2] = 2
if m == 0:
    for i in range(2,n+1):
        dp[i] = dp[i-1] + dp[i-2]
    print((dp[n]%(10**9+7)))
else:
    c = 0
    for i in range(1,n+1):
        if i == a[c]:
            dp[i] = 0
            if c < m-1:
                c += 1
        else:
            dp[i] = dp[i-1] + dp[i-2]

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


# Optimized solution
N, M = list(map(int, input().split()))
a = set([int(eval(input())) for i in range(M)])
MOD = 10 ** 9 + 7
dp = [1]
if 1 in a:
    dp.append(0)
else:
    dp.append(1)
for ith_stair in range(2, N + 1):
    if ith_stair in a:
        dp.append(0)
    else:
        dp.append((dp[ith_stair - 1] + dp[ith_stair - 2]) % MOD)
print((dp[N] % MOD))
# Original solution
#python3

MOD = int(1e9+7)

def main():
    n, m = list(map(int, input().split()))
    a = [int(eval(input())) for _ in range(m)]
    broken = [0]*(n+1)
    for i in a:
        broken[i] = 1; 

    dp = [0]*(n+2)
    dp[n] = 1
    for i in reversed(list(range(n))):
        if broken[i]:
            dp[i] = 0;
            continue; 
        dp[i] = (dp[i+1] + dp[i+2]) % MOD

    print((dp[0]))
main()

# Optimized solution
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    N, M, *a = list(map(int, read().split()))
    A = set()
    P = (10**9)+7
    for i in a:
        A.add(i)

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

    if not (1 in A):
        dp[1] = 1
        

    for i in range(2, N+1):
        if i in A:
            continue
        else:
            dp[i] = (dp[i-1] + dp[i-2])%P
    print((dp[N]))
if __name__ == '__main__':
    main()
# Original solution
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    N, M, *a = list(map(int, read().split()))
    A = set()
    P = (10**9)+7
    for i in a:
        A.add(i)

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

    if not (1 in A):
        dp[1] = 1
        

    for i in range(2, N+1):
        if i in A:
            continue
        else:
            dp[i] = (dp[i-1] + dp[i-2])%P
    print((dp[N]))
if __name__ == '__main__':
    main()


# Optimized solution
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    N, M, *a = list(map(int, read().split()))
    A = {i for i in a}
    P = (10**9)+7

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

    if not (1 in A):
        dp[1] = 1
        

    for i in range(2, N+1):
        if i in A:
            continue
        else:
            dp[i] = (dp[i-1] + dp[i-2])%P
    print((dp[N]))
if __name__ == '__main__':
    main()
# Original solution
n,m=list(map(int,input().split()))
a=[int(eval(input())) for i in range(m)]
dp=[0]*(n+1)
dp[0]=1
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
    if i in a:
        dp[i]=0
print((dp[n]))

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

broken = [0] * (n+1)
dp = [0] * (n+1)

for _ in range(m):
  broken[int(eval(input()))] = 1
  if broken[-1] == 1 and broken[-2] == 1:
    print((0))
    exit()

dp[0] = 1

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

if n == 1:
  print((dp[n]))
  exit()
else:
  for i in range(2, n+1):
    if broken[i] == 1:
      continue
    else:
      dp[i] = (dp[i-1] + dp[i-2]) % 1000000007

print((dp[n]))

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

dp = [0] * (n+1)
broken = [0] * (n+1)

for i in range(m):
    broken[int(eval(input()))] = 1

dp[0] = 1

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

if n == 1:
    print((dp[n]))
    exit()
else:
    for i in range(2, n+1):
        if broken[i] == 1:
            continue
        else:
            dp[i] = (dp[i-1] + dp[i-2]) % 1000000007
            
print((dp[n]))
# Original solution
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, list(range(n, n - r, -1)))
    under = reduce(mul, list(range(1,r + 1)))
    return over // under

def sumcmb(T):
    count=0
    m=T
    while m>=0:
        count+=cmb(T,m)
        T-=1
        m-=2
        count%=mod

    return(count)


N,M=list(map(int,input().split()))
A=[int(eval(input())) for i in range(M)]
mod=10**9+7
for i in range(M-1):
    if A[i]+1==A[i+1]:
        print((0))
        exit()

if 1 not in A:
    A.insert(0,-1)
if N not in A:
    A.append(N+1)


count=1
for i in range(len(A)-1):
    T=max(A[i+1]-1 - (A[i]+1),1)
    #print(sumcmb(T))
    count*=sumcmb(T)
    count%=mod

print(count)


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

data=[0 for i in range(N)]
if 1 not in A:
    data[0]=1
if N>=2:
    if 2 not in A:
        data[1]=1+data[0]


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

#print(data)

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

# Optimized solution
n, m = list(map(int, input().split()))
a = [int(eval(input())) for i in range(m)]
l = [1] * (n+1)
for j in a:
  l[j] = 0
x = 10 ** 9 + 7
if m > n // 2:
  print((0))
else:
  dp = [0] * (n+1)
  dp[0] = 1
  if 1 not in a:
    dp[1] = 1
  for i in range(2, n+1):
    if l[i]:
      dp[i] = (dp[i-1] + dp[i-2]) % x
  print((dp[-1]))
# Original solution
mod = 10**9+7
n, m = list(map(int, input().split()))
stairs = [0]*(n+1)
broken = []
stairs[0] = 1

for i in range(m):
    b = int(eval(input()))
    if broken and b-1 == broken[-1]:
        print((0))
        exit(0)
    broken.append(b)

for i in range(n+1):
    if i in broken:
        continue
    if i >= 2:
        stairs[i] = stairs[i-1] + stairs[i-2]
    elif i == 1:
        stairs[i] = stairs[i-1]

print((stairs[-1]%mod))




# Optimized solution
mod = 10**9+7
n, m = list(map(int, input().split()))
stairs = [0]*(n+1)
broken = []
stairs[0] = 1

def binSearch(broken, e):
    l, r = 0, m-1

    while l <= r:
        mid = (l+r)//2

        if broken[mid] > e:
            r = mid - 1
        elif broken[mid] < e:
            l = mid + 1
        else:
            return True
    return False


for i in range(m):
    b = int(eval(input()))
    if broken and b-1 == broken[-1]:
        print((0))
        exit(0)
    broken.append(b)

for i in range(n+1):
    if binSearch(broken, i):
        continue
    if i >= 2:
        stairs[i] = stairs[i-1] + stairs[i-2]
    elif i == 1:
        stairs[i] = stairs[i-1]

print((stairs[-1]%mod))
# 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):
	dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
	if i in A:
		dp[i]=0
print((dp[N]))

# 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
for i in range(1,N+1):
	dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
	if i in A:
		dp[i]=0
print((dp[N]))
# Original solution
N, M=list(map(int, input().split()))
mod=10**9+7
pre=-1
hole=[]
for i in range(M):
  a=int(eval(input()))
  hole.append(a-1-pre)
  pre=a
hole.append(N-pre)

  

dp=[0]*(N+3)
dp[1]=1
dp[2]=1
for i in range(3,N+3):
  dp[i]=(dp[i-1]+dp[i-2])%mod

  
#print(dp)
#print(hole)
ans=1
for h in hole:
  ans*=dp[h]
  ans%=mod
  
print(ans)

# Optimized solution
N, M=list(map(int, input().split()))
mod=10**9+7
pre=-1
hole=[]
for i in range(M):
  a=int(eval(input()))
  hole.append(a-1-pre)
  pre=a
hole.append(N-pre)

  

dp=[0]*(N+3)
dp[1]=1
dp[2]=1
for i in range(3,N+3):
  dp[i]=(dp[i-1]+dp[i-2])%mod
if len(hole)==1:
  print((dp[N+1]))
  exit()
#print(dp)
#print(hole)
ans=1
for h in hole:
  ans*=dp[h]
  ans%=mod
  
print(ans)