

import sys

input = sys.stdin.readline

sys.setrecursionlimit(10**6)

##############################



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

A = [0] * M

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



for i in range(M):

    a = int(eval(input()))

    dp[a] = 0



dp[0] = 1

if dp[1] != 0:

    dp[1] = 1



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

    if dp[i] != 0:

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



print((dp[N] % 1000000007))


import sys

input = sys.stdin.readline

sys.setrecursionlimit(10**6)

##############################



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

A = [0] * M

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



for i in range(M):

    a = int(eval(input()))

    dp[a] = 0



dp[0] = 1

if dp[1] != 0:

    dp[1] = 1



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

    if dp[i] != 0:

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



print((dp[N]))

import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################
N, M = list(map(int, input().split()))
A = [0] * M
dp = [-1] * (N + 1)
for i in range(M):
    a = int(eval(input()))
    dp[a] = 0
dp[0] = 1
if dp[1] != 0:
    dp[1] = 1
for i in range(2, N + 1):
    if dp[i] != 0:
        dp[i] = dp[i - 1] + dp[i - 2]
print((dp[N] % 1000000007))

import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################
N, M = list(map(int, input().split()))
A = [0] * M
dp = [-1] * (N + 1)
for i in range(M):
    a = int(eval(input()))
    dp[a] = 0
dp[0] = 1
if dp[1] != 0:
    dp[1] = 1
for i in range(2, N + 1):
    if dp[i] != 0:
        dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000007
print((dp[N]))

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