MOD = 10**9 + 7



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

dp = [0]*(N+1)

dp[0] = 1

A = set(int(eval(input())) for _ in range(M)) # 禁止地帯



for i in range(1,N+1):

  if i in A:

    continue

  x = dp[i-1]

  if i > 1:

    x += dp[i-2]

  dp[i] = x%MOD



answer = dp[N]

print(answer)
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



N,M,*A = list(map(int,read().split()))



MOD = 10**9 + 7



dp = [0] * (N+10)

dp[0] = 1

is_broken = [False] * (N+1)



for x in A:

    is_broken[x] = True



for n in range(1,N+1):

    if is_broken[n]:

        continue

    x = dp[n-1] + dp[n-2]

    if x >= MOD:

        x -= MOD

    dp[n] = x



answer = dp[N]

print(answer)
MOD = 10**9 + 7
N, M = list(map(int, input().split()))
dp = [0] * (N + 1)
dp[0] = 1
A = set(int(eval(input())) for _ in range(M))  # 禁止地帯
for i in range(1, N + 1):
    if i in A:
        continue
    x = dp[i - 1]
    if i > 1:
        x += dp[i - 2]
    dp[i] = x % MOD
answer = dp[N]
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, M, *A = list(map(int, read().split()))
MOD = 10**9 + 7
dp = [0] * (N + 10)
dp[0] = 1
is_broken = [False] * (N + 1)
for x in A:
    is_broken[x] = True
for n in range(1, N + 1):
    if is_broken[n]:
        continue
    x = dp[n - 1] + dp[n - 2]
    if x >= MOD:
        x -= MOD
    dp[n] = x
answer = dp[N]
print(answer)

+import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +N, M, *A = list(map(int, read().split())) -N, M = list(map(int, input().split())) -dp = [0] * (N + 1) +dp = [0] * (N + 10) -A = set(int(eval(input())) for _ in range(M))  # 禁止地帯 -for i in range(1, N + 1): -    if i in A: +is_broken = [False] * (N + 1) +for x in A: +    is_broken[x] = True +for n in range(1, N + 1): +    if is_broken[n]: -    x = dp[i - 1] -    if i > 1: -        x += dp[i - 2] -    dp[i] = x % MOD +    x = dp[n - 1] + dp[n - 2] +    if x >= MOD: +        x -= MOD +    dp[n] = x