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

A=[int(eval(input())) for i in range(m)]

mod=10**9+7

flag=1

S=[0 for i in range(n+3)]

S[0]=1

SET=set(A)

for i in range(n):

    if i in SET:

        S[i]=0

        if i+1 in SET:

            flag=0

    S[i+1]+=S[i]

    S[i+2]+=S[i]

    

print((S[n]%mod if flag==1 else 0))

#配る方で解いてみた。
import sys

input=sys.stdin.buffer.readline

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

mod=10**9+7

dp=[0]*(n+1)

for _ in range(m):

    a=int(eval(input()))

    dp[a]=-1

dp[0]=1

for i in range(n):

    if dp[i]>=0:

        if i+1<=n:

            if dp[i+1]>=0:

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

                dp[i+1]%=mod

        if i+2<=n:

            if dp[i+2]>=0:

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

                dp[i+2]%=mod

print((dp[n] if dp[n]>0 else 0))
n, m = list(map(int, input().split()))
A = [int(eval(input())) for i in range(m)]
mod = 10**9 + 7
flag = 1
S = [0 for i in range(n + 3)]
S[0] = 1
SET = set(A)
for i in range(n):
    if i in SET:
        S[i] = 0
        if i + 1 in SET:
            flag = 0
    S[i + 1] += S[i]
    S[i + 2] += S[i]
print((S[n] % mod if flag == 1 else 0))
# 配る方で解いてみた。

import sys

input = sys.stdin.buffer.readline
n, m = list(map(int, input().split()))
mod = 10**9 + 7
dp = [0] * (n + 1)
for _ in range(m):
    a = int(eval(input()))
    dp[a] = -1
dp[0] = 1
for i in range(n):
    if dp[i] >= 0:
        if i + 1 <= n:
            if dp[i + 1] >= 0:
                dp[i + 1] += dp[i]
                dp[i + 1] %= mod
        if i + 2 <= n:
            if dp[i + 2] >= 0:
                dp[i + 2] += dp[i]
                dp[i + 2] %= mod
print((dp[n] if dp[n] > 0 else 0))

+import sys + +input = sys.stdin.buffer.readline -A = [int(eval(input())) for i in range(m)] -flag = 1 -S = [0 for i in range(n + 3)] -S[0] = 1 -SET = set(A) +dp = [0] * (n + 1) +for _ in range(m): +    a = int(eval(input())) +    dp[a] = -1 +dp[0] = 1 -    if i in SET: -        S[i] = 0 -        if i + 1 in SET: -            flag = 0 -    S[i + 1] += S[i] -    S[i + 2] += S[i] -print((S[n] % mod if flag == 1 else 0)) -# 配る方で解いてみた。 +    if dp[i] >= 0: +        if i + 1 <= n: +            if dp[i + 1] >= 0: +                dp[i + 1] += dp[i] +                dp[i + 1] %= mod +        if i + 2 <= n: +            if dp[i + 2] >= 0: +                dp[i + 2] += dp[i] +                dp[i + 2] %= mod +print((dp[n] if dp[n] > 0 else 0))