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

mod=10**9+7



NG=[0]*(n+1)

dp=[0]*(n+1)

dp[0]=1



for _ in range(m):

    a=int(eval(input()))

    NG[a]=1



for i in range(n):

    if i==0:            #一段目

        dp[i+1]=dp[i] if NG[i+1]==0 else 0

        continue



    if NG[i+1]==1:

        dp[i+1]=0

    else:

        dp[i+1]=dp[i]+dp[i-1]

        dp[i+1]%=mod



print((dp[n]))
import sys

input = sys.stdin.buffer.readline

sys.setrecursionlimit(10 ** 7)

mod = 10 ** 9 + 7





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

a = [int(eval(input())) for _ in range(M)]

a.append(-1)

a = a[::-1]



dp = [0] * (N + 10)

dp[0] = 1



# 配る

for i in range(N):

    if i == a[-1]:

        a.pop()

        dp[i] = 0

        continue

    dp[i + 1] += dp[i]

    dp[i + 1] %= mod

    dp[i + 2] += dp[i]

    dp[i + 2] %= mod



ans = dp[N]

print(ans)

n, m = list(map(int, input().split()))
mod = 10**9 + 7
NG = [0] * (n + 1)
dp = [0] * (n + 1)
dp[0] = 1
for _ in range(m):
    a = int(eval(input()))
    NG[a] = 1
for i in range(n):
    if i == 0:  # 一段目
        dp[i + 1] = dp[i] if NG[i + 1] == 0 else 0
        continue
    if NG[i + 1] == 1:
        dp[i + 1] = 0
    else:
        dp[i + 1] = dp[i] + dp[i - 1]
        dp[i + 1] %= mod
print((dp[n]))

import sys

input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
mod = 10**9 + 7
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
a.append(-1)
a = a[::-1]
dp = [0] * (N + 10)
dp[0] = 1
# 配る
for i in range(N):
    if i == a[-1]:
        a.pop()
        dp[i] = 0
        continue
    dp[i + 1] += dp[i]
    dp[i + 1] %= mod
    dp[i + 2] += dp[i]
    dp[i + 2] %= mod
ans = dp[N]
print(ans)

-n, m = list(map(int, input().split())) +import sys + +input = sys.stdin.buffer.readline +sys.setrecursionlimit(10**7) -NG = [0] * (n + 1) -dp = [0] * (n + 1) +N, M = list(map(int, input().split())) +a = [int(eval(input())) for _ in range(M)] +a.append(-1) +a = a[::-1] +dp = [0] * (N + 10) -for _ in range(m): -    a = int(eval(input())) -    NG[a] = 1 -for i in range(n): -    if i == 0:  # 一段目 -        dp[i + 1] = dp[i] if NG[i + 1] == 0 else 0 +# 配る +for i in range(N): +    if i == a[-1]: +        a.pop() +        dp[i] = 0 -    if NG[i + 1] == 1: -        dp[i + 1] = 0 -    else: -        dp[i + 1] = dp[i] + dp[i - 1] -        dp[i + 1] %= mod -print((dp[n])) +    dp[i + 1] += dp[i] +    dp[i + 1] %= mod +    dp[i + 2] += dp[i] +    dp[i + 2] %= mod +ans = dp[N] +print(ans)