from collections import defaultdict as dd

n,m=[int(i) for i in input().split()]

brkn = dd(int)

mod = 10**9+7

for i in range(m):

    num = int(eval(input()))

    brkn[num]+=1

dp = [0]*(n+1)

dp[0]=1

if(1 in brkn):

    dp[1]=0

else:

    dp[1]=1

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

    if(i in brkn):

        dp[i]=0

    else:

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

print((dp[n]))

        

import sys

sys.setrecursionlimit(10**6)



from collections import defaultdict as dd

n,m=[int(i) for i in input().split()]

brkn = dd(int)

mod = 10**9+7

for i in range(m):

    num = int(eval(input()))

    brkn[num]+=1

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



def func(curr):

    if(curr==0):

        dp[0]=1

        return dp[0]

    if(curr>0 and (curr in brkn)):

        dp[curr]=0

        return dp[curr]%mod

    if(curr==1):

        dp[1]=1

        return dp[1]

    if(dp[curr]!=-1):

        return dp[curr]%mod

    else:

        dp[curr] =  (func(curr-1) + func(curr-2))%mod

        return dp[curr]%mod



print((func(n)))

        

from collections import defaultdict as dd

n, m = [int(i) for i in input().split()]
brkn = dd(int)
mod = 10**9 + 7
for i in range(m):
    num = int(eval(input()))
    brkn[num] += 1
dp = [0] * (n + 1)
dp[0] = 1
if 1 in brkn:
    dp[1] = 0
else:
    dp[1] = 1
for i in range(2, n + 1):
    if i in brkn:
        dp[i] = 0
    else:
        dp[i] = (dp[i - 1] + dp[i - 2]) % mod
print((dp[n]))

import sys

sys.setrecursionlimit(10**6)
from collections import defaultdict as dd

n, m = [int(i) for i in input().split()]
brkn = dd(int)
mod = 10**9 + 7
for i in range(m):
    num = int(eval(input()))
    brkn[num] += 1
dp = [-1] * (n + 1)


def func(curr):
    if curr == 0:
        dp[0] = 1
        return dp[0]
    if curr > 0 and (curr in brkn):
        dp[curr] = 0
        return dp[curr] % mod
    if curr == 1:
        dp[1] = 1
        return dp[1]
    if dp[curr] != -1:
        return dp[curr] % mod
    else:
        dp[curr] = (func(curr - 1) + func(curr - 2)) % mod
        return dp[curr] % mod


print((func(n)))

+import sys + +sys.setrecursionlimit(10**6) -dp = [0] * (n + 1) -dp[0] = 1 -if 1 in brkn: -    dp[1] = 0 -else: -    dp[1] = 1 -for i in range(2, n + 1): -    if i in brkn: -        dp[i] = 0 +dp = [-1] * (n + 1) + + +def func(curr): +    if curr == 0: +        dp[0] = 1 +        return dp[0] +    if curr > 0 and (curr in brkn): +        dp[curr] = 0 +        return dp[curr] % mod +    if curr == 1: +        dp[1] = 1 +        return dp[1] +    if dp[curr] != -1: +        return dp[curr] % mod -        dp[i] = (dp[i - 1] + dp[i - 2]) % mod -print((dp[n])) +        dp[curr] = (func(curr - 1) + func(curr - 2)) % mod +        return dp[curr] % mod + + +print((func(n)))