import sys

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

dp=[1]*N

listA=[]

for i in range(M):

  a=int(eval(input()))

  listA+=[a]

  dp[a-1]=0

for i in range(1,M):

  if listA[i]==listA[i-1]:

    print((0))

    sys.exit()

setA=set(listA)    

if (1 not in setA) and (2 not in setA) and N!=1:

  dp[1]=2

for i in range(2,N):

  if i+1 not in setA:

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

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

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

dp=[1]*N

listA=[]

for i in range(M):

  a=int(eval(input()))

  listA+=[a]

  dp[a-1]=0

setA=set(listA)    

if (1 not in setA) and (2 not in setA) and N!=1:

  dp[1]=2

for i in range(2,N):

  if i+1 not in setA:

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

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

print(ans)
import sys

N, M = list(map(int, input().split()))
dp = [1] * N
listA = []
for i in range(M):
    a = int(eval(input()))
    listA += [a]
    dp[a - 1] = 0
for i in range(1, M):
    if listA[i] == listA[i - 1]:
        print((0))
        sys.exit()
setA = set(listA)
if (1 not in setA) and (2 not in setA) and N != 1:
    dp[1] = 2
for i in range(2, N):
    if i + 1 not in setA:
        dp[i] = dp[i - 1] + dp[i - 2]
ans = dp[-1] % (10**9 + 7)
print(ans)

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

-import sys - -for i in range(1, M): -    if listA[i] == listA[i - 1]: -        print((0)) -        sys.exit()