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

A = [None]*M



is_broken = [False] * (N+1)



for i in range(M):

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

    is_broken[A[i]] = True



dp = [0] * (N+1)

dp[0] = 1



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

    if is_broken[i]:

        continue

    dp[i]  = (dp[i-1] + dp[i-2]) % (10**9 + 7)



print((dp[-1]))
n, m = list(map(int, input().split()))

arr = set([int(eval(input())) for _ in range(m)])



MOD = 10**9 + 7



dp = [0] * (n + 1)

dp[0] = 1



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

    if not i in arr:

        if i == 1:

            dp[i] = dp[i - 1] % MOD

        else:

            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD



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

n, m = list(map(int, input().split()))
arr = set([int(eval(input())) for _ in range(m)])
MOD = 10**9 + 7
dp = [0] * (n + 1)
dp[0] = 1
for i in range(1, n + 1):
    if not i in arr:
        if i == 1:
            dp[i] = dp[i - 1] % MOD
        else:
            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD
print((dp[-1]))

-N, M = list(map(int, input().split())) -A = [None] * M -is_broken = [False] * (N + 1) -for i in range(M): -    A[i] = int(eval(input())) -    is_broken[A[i]] = True -dp = [0] * (N + 1) +n, m = list(map(int, input().split())) +arr = set([int(eval(input())) for _ in range(m)]) +MOD = 10**9 + 7 +dp = [0] * (n + 1) -for i in range(1, N + 1): -    if is_broken[i]: -        continue -    dp[i] = (dp[i - 1] + dp[i - 2]) % (10**9 + 7) +for i in range(1, n + 1): +    if not i in arr: +        if i == 1: +            dp[i] = dp[i - 1] % MOD +        else: +            dp[i] = (dp[i - 1] + dp[i - 2]) % MOD