n, m = list(map(int, input().split()))



S = [1] * (n + 1)

for _ in range(m):

    a = int(eval(input()))

    S[a] = 0



i = -3

for _ in range(n - 1):

    if S[i] != 0:

        S[i] = S[i + 1] + S[i + 2]

    i -= 1



ans = S[0] % (10**9 + 7)

print(ans)

n, m = list(map(int, input().split()))



S = [1] * (n + 1)

for _ in range(m):

    a = int(eval(input()))

    S[a] = 0



mod = 10**9 + 7

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

    if S[i] != 0:

        S[i] = (S[i - 1] + S[i - 2]) % mod



ans = S[n]

print(ans)

n, m = list(map(int, input().split()))
S = [1] * (n + 1)
for _ in range(m):
    a = int(eval(input()))
    S[a] = 0
i = -3
for _ in range(n - 1):
    if S[i] != 0:
        S[i] = S[i + 1] + S[i + 2]
    i -= 1
ans = S[0] % (10**9 + 7)
print(ans)

n, m = list(map(int, input().split()))
S = [1] * (n + 1)
for _ in range(m):
    a = int(eval(input()))
    S[a] = 0
mod = 10**9 + 7
for i in range(2, n + 1):
    if S[i] != 0:
        S[i] = (S[i - 1] + S[i - 2]) % mod
ans = S[n]
print(ans)

-i = -3 -for _ in range(n - 1): +mod = 10**9 + 7 +for i in range(2, n + 1): -        S[i] = S[i + 1] + S[i + 2] -    i -= 1 -ans = S[0] % (10**9 + 7) +        S[i] = (S[i - 1] + S[i - 2]) % mod +ans = S[n]