p = 10**9+7

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

A = [0 for _ in range(N+1)]

for _ in range(M):

    i = int(eval(input()))

    A[i] = 1

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

dp[0] = 1

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

    if A[i]==0:

        dp[i] = dp[i-1]

        if i>=2:

            dp[i] = (dp[i]+dp[i-2])%p

print((dp[N]))
p = 10**9+7

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

A = {i:0 for i in range(N+1)}

for _ in range(M):

    A[int(eval(input()))] = 1

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

dp[N] = 1

for i in range(N-1,-1,-1):

    if A[i]==1:continue

    if A[i+1]==0:

        dp[i] = dp[i+1]

    if i+2<=N and A[i+2]==0:

        dp[i] = (dp[i]+dp[i+2])%p

print((dp[0]))
p = 10**9 + 7
N, M = list(map(int, input().split()))
A = [0 for _ in range(N + 1)]
for _ in range(M):
    i = int(eval(input()))
    A[i] = 1
dp = [0 for _ in range(N + 1)]
dp[0] = 1
for i in range(1, N + 1):
    if A[i] == 0:
        dp[i] = dp[i - 1]
        if i >= 2:
            dp[i] = (dp[i] + dp[i - 2]) % p
print((dp[N]))

p = 10**9 + 7
N, M = list(map(int, input().split()))
A = {i: 0 for i in range(N + 1)}
for _ in range(M):
    A[int(eval(input()))] = 1
dp = [0 for _ in range(N + 1)]
dp[N] = 1
for i in range(N - 1, -1, -1):
    if A[i] == 1:
        continue
    if A[i + 1] == 0:
        dp[i] = dp[i + 1]
    if i + 2 <= N and A[i + 2] == 0:
        dp[i] = (dp[i] + dp[i + 2]) % p
print((dp[0]))

-A = [0 for _ in range(N + 1)] +A = {i: 0 for i in range(N + 1)} -    i = int(eval(input())) -    A[i] = 1 +    A[int(eval(input()))] = 1 -dp[0] = 1 -for i in range(1, N + 1): -    if A[i] == 0: -        dp[i] = dp[i - 1] -        if i >= 2: -            dp[i] = (dp[i] + dp[i - 2]) % p -print((dp[N])) +dp[N] = 1 +for i in range(N - 1, -1, -1): +    if A[i] == 1: +        continue +    if A[i + 1] == 0: +        dp[i] = dp[i + 1] +    if i + 2 <= N and A[i + 2] == 0: +        dp[i] = (dp[i] + dp[i + 2]) % p +print((dp[0]))