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

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

A = [0] * (N+3)

for a in A_:

    A[a] = 1

dp = [0] * (N+3)

dp[0] = 1



mod = 10**9+7



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

    if A[i-1] == 0:

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

    if A[i-2] == 0:

        dp[i] += dp[i-2]

    dp[i] %= mod

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

dp=[0]*(n+3)

a=[int(eval(input())) for i in range(m)]

mod=10**9+7

for i in range(m):

    dp[a[i]]=-1



dp[0]=1

if dp[1]!=-1:

    dp[1]+=dp[0]



for i in range(n+1):

    if dp[i+2]==-1:

        continue

    if dp[i]!=-1:

        dp[i+2]+=dp[i]

    if dp[i+1]!=-1:

        dp[i+2]+=dp[i+1]

    dp[i+2]%=mod

print((dp[n]%mod))
N, M = list(map(int, input().split()))
A_ = [int(eval(input())) for _ in range(M)]
A = [0] * (N + 3)
for a in A_:
    A[a] = 1
dp = [0] * (N + 3)
dp[0] = 1
mod = 10**9 + 7
for i in range(1, N + 1):
    if A[i - 1] == 0:
        dp[i] += dp[i - 1]
    if A[i - 2] == 0:
        dp[i] += dp[i - 2]
    dp[i] %= mod
print((dp[N]))

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

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