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

#a = [int(input()) for i in range(m)]

a=set()

for i in range(m):

    tmp=int(eval(input()))

    a.add(tmp)

mod = 10**9+7

dp = [0]*(n+1)

dp[0] = 1

j=0

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

  if i in a:

    #dp[a[j]] = 0 

    continue

  if i==1:

    dp[1] = dp[0]

    continue

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

  dp[i]%=mod

print((dp[n]))
#!/usr/bin/env python3

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

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

dp = [-1]*(n+2)#dp[k]はk-1段目に到達する方法

dp[0] = 0

dp[1] = 1

mod = 10**9+7

for i in a:

    dp[i+1] = 0

for i in range(n+2):

    if dp[i] == -1:#already visited or prepared

        dp[i] = (dp[i-1]+dp[i-2])

#print(dp)

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

#!/usr/bin/env python3
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
dp = [-1] * (n + 2)  # dp[k]はk-1段目に到達する方法
dp[0] = 0
dp[1] = 1
mod = 10**9 + 7
for i in a:
    dp[i + 1] = 0
for i in range(n + 2):
    if dp[i] == -1:  # already visited or prepared
        dp[i] = dp[i - 1] + dp[i - 2]
# print(dp)
print((dp[n + 1] % mod))

+#!/usr/bin/env python3 -# a = [int(input()) for i in range(m)] -a = set() -for i in range(m): -    tmp = int(eval(input())) -    a.add(tmp) +a = [int(eval(input())) for _ in range(m)] +dp = [-1] * (n + 2)  # dp[k]はk-1段目に到達する方法 +dp[0] = 0 +dp[1] = 1 -dp = [0] * (n + 1) -dp[0] = 1 -j = 0 -for i in range(1, n + 1): -    if i in a: -        # dp[a[j]] = 0 -        continue -    if i == 1: -        dp[1] = dp[0] -        continue -    dp[i] = dp[i - 1] + dp[i - 2] -    dp[i] %= mod -print((dp[n])) +for i in a: +    dp[i + 1] = 0 +for i in range(n + 2): +    if dp[i] == -1:  # already visited or prepared +        dp[i] = dp[i - 1] + dp[i - 2] +# print(dp) +print((dp[n + 1] % mod))