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

MOD = 10**9+7

dp = [0]*(N+1)

dp[0]=1

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

ban = [1]*(N+1)

for a in A:

    ban[a]=0

for i in range(N):

    if i-1>=0:

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

    else:

        dp[i+1]=dp[i]*ban[i]

    dp[i+1] %= MOD 

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

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

MOD = 10**9+7

A = set(A)

dp = [0]*(N+1)

dp[0] = 1

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

    if i in A:

        continue

    if i == 1:

        dp[1] = dp[0]

    else:

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

print((dp[N]))
N, M = list(map(int, input().split()))
MOD = 10**9 + 7
dp = [0] * (N + 1)
dp[0] = 1
A = [int(eval(input())) for i in range(M)]
ban = [1] * (N + 1)
for a in A:
    ban[a] = 0
for i in range(N):
    if i - 1 >= 0:
        dp[i + 1] = dp[i] * ban[i] + dp[i - 1] * ban[i - 1]
    else:
        dp[i + 1] = dp[i] * ban[i]
    dp[i + 1] %= MOD
print((dp[N]))

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

+A = [int(eval(input())) for i in range(M)] +A = set(A) -A = [int(eval(input())) for i in range(M)] -ban = [1] * (N + 1) -for a in A: -    ban[a] = 0 -for i in range(N): -    if i - 1 >= 0: -        dp[i + 1] = dp[i] * ban[i] + dp[i - 1] * ban[i - 1] +for i in range(1, N + 1): +    if i in A: +        continue +    if i == 1: +        dp[1] = dp[0] -        dp[i + 1] = dp[i] * ban[i] -    dp[i + 1] %= MOD +        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD