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

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

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

for i in range(n):

    if i in A:

        continue

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

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

print((dp[n]%(10**9 + 7)))
from collections import deque



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

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

L=deque([1,1])

if 1 in A:L[1]=0

for i in range(2,n+1):

    if i in A:

        L.append(0)

    else:

        L.append(L[i-2]+L[i-1])

print((L[n]%(10**9 + 7)))

n, m = list(map(int, input().split()))
A = {int(eval(input())) for _ in range(m)}
dp = [1] + [0] * (n + 1)
for i in range(n):
    if i in A:
        continue
    dp[i + 1] += dp[i]
    dp[i + 2] += dp[i]
print((dp[n] % (10**9 + 7)))

from collections import deque

n, m = list(map(int, input().split()))
A = {int(eval(input())) for _ in range(m)}
L = deque([1, 1])
if 1 in A:
    L[1] = 0
for i in range(2, n + 1):
    if i in A:
        L.append(0)
    else:
        L.append(L[i - 2] + L[i - 1])
print((L[n] % (10**9 + 7)))

+from collections import deque + -dp = [1] + [0] * (n + 1) -for i in range(n): +L = deque([1, 1]) +if 1 in A: +    L[1] = 0 +for i in range(2, n + 1): -        continue -    dp[i + 1] += dp[i] -    dp[i + 2] += dp[i] -print((dp[n] % (10**9 + 7))) +        L.append(0) +    else: +        L.append(L[i - 2] + L[i - 1]) +print((L[n] % (10**9 + 7)))