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

A = set([int(eval(input())) for _ in range(M)])



dp = [0, 1]

for i in range(N):

    if i+1 in A: dp.append(0)

    else: dp.append(dp[i]+dp[i+1])

print((dp[N+1]%1000000007))
N, M = [int(i) for i in input().split()]

A = {int(eval(input())) for _ in range(M)}



dp = [0] * 101000

dp[0] = 1

dp[1] = 0 if 1 in A else 1



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

    if not i-1 in A:

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

    if not i-2 in A:

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

    dp[i] %= 1000000007



print((dp[N]))

N, M = list(map(int, input().split()))
A = set([int(eval(input())) for _ in range(M)])
dp = [0, 1]
for i in range(N):
    if i + 1 in A:
        dp.append(0)
    else:
        dp.append(dp[i] + dp[i + 1])
print((dp[N + 1] % 1000000007))

N, M = [int(i) for i in input().split()]
A = {int(eval(input())) for _ in range(M)}
dp = [0] * 101000
dp[0] = 1
dp[1] = 0 if 1 in A else 1
for i in range(2, N + 1):
    if not i - 1 in A:
        dp[i] += dp[i - 1]
    if not i - 2 in A:
        dp[i] += dp[i - 2]
    dp[i] %= 1000000007
print((dp[N]))

-N, M = list(map(int, input().split())) -A = set([int(eval(input())) for _ in range(M)]) -dp = [0, 1] -for i in range(N): -    if i + 1 in A: -        dp.append(0) -    else: -        dp.append(dp[i] + dp[i + 1]) -print((dp[N + 1] % 1000000007)) +N, M = [int(i) for i in input().split()] +A = {int(eval(input())) for _ in range(M)} +dp = [0] * 101000 +dp[0] = 1 +dp[1] = 0 if 1 in A else 1 +for i in range(2, N + 1): +    if not i - 1 in A: +        dp[i] += dp[i - 1] +    if not i - 2 in A: +        dp[i] += dp[i - 2] +    dp[i] %= 1000000007 +print((dp[N]))