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



halls = [int(eval(input())) for i in range(M)]



dp = [1] * (N + 1)

for i in range(len(halls)):

    dp[halls[i]] = 0



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

    if dp[i] == 0:

        continue

    dp[i] = dp[max(0, i - 1)] + dp[max(0, i - 2)]



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



halls = [int(eval(input())) for i in range(M)]



dp = [1] * (N + 1)

for i in range(len(halls)):

    dp[halls[i]] = 0



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

    if dp[i] == 0:

        continue

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



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

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

-    dp[i] = dp[max(0, i - 1)] + dp[max(0, i - 2)] +    dp[i] = dp[i - 1] + dp[i - 2]