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

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

mod=10**9+7

dp=[0 for i in range(N+1)]

dp[0] = 1

is_broken =[1 for i in range(N+1)]



for i in range(M):

    is_broken[items[i]] = 0



for i in range(N):

    if i-1 >= 0:

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

    else:

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

    dp[i+1] %= mod



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

mod=10**9+7

dp=[0 for i in range(N+2)]

dp[N] = 1

is_broken =[False for i in range(N+1)]



for i in range(M):

    a=int(eval(input()))

    is_broken[a] = True



for i in reversed(list(range(N))):

    if is_broken[i]:

        dp[i] = 0

        continue

    dp[i] = (dp[i+1] + dp[i+2]) % mod



print((dp[0]))

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

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

-items = [int(eval(input())) for i in range(M)] -dp = [0 for i in range(N + 1)] -dp[0] = 1 -is_broken = [1 for i in range(N + 1)] +dp = [0 for i in range(N + 2)] +dp[N] = 1 +is_broken = [False for i in range(N + 1)] -    is_broken[items[i]] = 0 -for i in range(N): -    if i - 1 >= 0: -        dp[i + 1] = dp[i] * is_broken[i] + dp[i - 1] * is_broken[i - 1] -    else: -        dp[i + 1] = dp[i] * is_broken[i] -    dp[i + 1] %= mod -print((dp[N])) +    a = int(eval(input())) +    is_broken[a] = True +for i in reversed(list(range(N))): +    if is_broken[i]: +        dp[i] = 0 +        continue +    dp[i] = (dp[i + 1] + dp[i + 2]) % mod +print((dp[0]))