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

arr = []

for i in range(M):

    arr.append(int(eval(input()))) 



arr.append(10**10)



dp = [0 for i in range(N+1)]

dp[0] = 1



tmp = 0



if arr[0] == 1:

    dp[1] = 0

    tmp += 1

else:

    dp[1] = 1



for i in range(N-1):

    if arr[tmp] == i+2:

        dp[i+2] = 0

        tmp += 1

        continue

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



print((dp[N]%(1000000007)))
N, M = list(map(int, input().split()))

arr = []

MOD = 1000000007

for i in range(M):

    arr.append(int(eval(input()))) 



arr.append(10**10)



dp = [0 for i in range(N+1)]

dp[0] = 1



tmp = 0



if arr[0] == 1:

    dp[1] = 0

    tmp += 1

else:

    dp[1] = 1



for i in range(N-1):

    if arr[tmp] == i+2:

        dp[i+2] = 0

        tmp += 1

        continue

    dp[i+2] = (dp[i+1] + dp[i]) % MOD



print((dp[N]))
N, M = list(map(int, input().split()))
arr = []
for i in range(M):
    arr.append(int(eval(input())))
arr.append(10**10)
dp = [0 for i in range(N + 1)]
dp[0] = 1
tmp = 0
if arr[0] == 1:
    dp[1] = 0
    tmp += 1
else:
    dp[1] = 1
for i in range(N - 1):
    if arr[tmp] == i + 2:
        dp[i + 2] = 0
        tmp += 1
        continue
    dp[i + 2] = dp[i + 1] + dp[i]
print((dp[N] % (1000000007)))

N, M = list(map(int, input().split()))
arr = []
MOD = 1000000007
for i in range(M):
    arr.append(int(eval(input())))
arr.append(10**10)
dp = [0 for i in range(N + 1)]
dp[0] = 1
tmp = 0
if arr[0] == 1:
    dp[1] = 0
    tmp += 1
else:
    dp[1] = 1
for i in range(N - 1):
    if arr[tmp] == i + 2:
        dp[i + 2] = 0
        tmp += 1
        continue
    dp[i + 2] = (dp[i + 1] + dp[i]) % MOD
print((dp[N]))

+MOD = 1000000007 -    dp[i + 2] = dp[i + 1] + dp[i] -print((dp[N] % (1000000007))) +    dp[i + 2] = (dp[i + 1] + dp[i]) % MOD +print((dp[N]))