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

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



MOD = 10 ** 9 + 7



am = set()

for a in A:

	am |= {a}



dp = [1] + [0] * (N + 10)



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

	if n in am:

		continue

	dp[n] = (dp[n - 1] + (dp[n - 2] if 2 <= n else 0)) % MOD



#print(dp)

print((dp[N]))

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

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



MOD = 10 ** 9 + 7



dp = [1] + [0] * (N + 10)



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

	if n in A:

		continue

	dp[n] = (dp[n - 1] + (dp[n - 2] if 2 <= n else 0)) % MOD



print((dp[N]))

N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]
MOD = 10**9 + 7
am = set()
for a in A:
    am |= {a}
dp = [1] + [0] * (N + 10)
for n in range(1, N + 1):
    if n in am:
        continue
    dp[n] = (dp[n - 1] + (dp[n - 2] if 2 <= n else 0)) % MOD
# print(dp)
print((dp[N]))

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

-A = [int(eval(input())) for _ in range(M)] +A = {int(eval(input())) for _ in range(M)} -am = set() -for a in A: -    am |= {a} -    if n in am: +    if n in A: -# print(dp)