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



dp=[0]*(N+1)

dp[0]=1

for _ in range(M):

    a=int(eval(input()))

    dp[a]=-1



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

    if dp[i]==-1:

        continue

    if dp[i-1]!=-1:

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

    if i>1 and dp[i-2]!=-1:

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



if dp[-1]==-1:

    print((0))

else:

    print((dp[-1]%(10**9+7)))

import sys

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

S=set(map(int,sys.stdin))



a,b=0,1

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

    if i in S:

        a,b=b,0

    else:

        a,b=b,a+b



print((b%(10**9+7)))

N, M = list(map(int, input().split()))
dp = [0] * (N + 1)
dp[0] = 1
for _ in range(M):
    a = int(eval(input()))
    dp[a] = -1
for i in range(1, N + 1):
    if dp[i] == -1:
        continue
    if dp[i - 1] != -1:
        dp[i] += dp[i - 1]
    if i > 1 and dp[i - 2] != -1:
        dp[i] += dp[i - 2]
if dp[-1] == -1:
    print((0))
else:
    print((dp[-1] % (10**9 + 7)))

import sys

N, M = list(map(int, input().split()))
S = set(map(int, sys.stdin))
a, b = 0, 1
for i in range(1, N + 1):
    if i in S:
        a, b = b, 0
    else:
        a, b = b, a + b
print((b % (10**9 + 7)))

+import sys + -dp = [0] * (N + 1) -dp[0] = 1 -for _ in range(M): -    a = int(eval(input())) -    dp[a] = -1 +S = set(map(int, sys.stdin)) +a, b = 0, 1 -    if dp[i] == -1: -        continue -    if dp[i - 1] != -1: -        dp[i] += dp[i - 1] -    if i > 1 and dp[i - 2] != -1: -        dp[i] += dp[i - 2] -if dp[-1] == -1: -    print((0)) -else: -    print((dp[-1] % (10**9 + 7))) +    if i in S: +        a, b = b, 0 +    else: +        a, b = b, a + b +print((b % (10**9 + 7)))