n,m = list(map(int,input().split()))

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

B = [0 for i in range(10**5+10)]

for i in range(len(A)):

    B[A[i]] = 1



mod = 10**9 + 7



DP = [1,1]

if B[1] == 1:

    DP[1] = 0

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

    p1 = DP[i-2] % mod

    p2 = DP[i-1] % mod

    if B[i-2] == 1:

        p1 = 0

    if B[i-1] == 1:

        p2 = 0

    DP.append((p1+p2)%mod)

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

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

B = [0 for i in range(10**5+10)]

for i in range(len(A)):

    B[A[i]] = 1



mod = 10**9 + 7



DP = [1,1]

if B[1] == 1:

    DP[1] = 0

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

    if B[i] == 0:

        DP.append((DP[i-1]+DP[i-2])%mod)

    else:

        DP.append(0)

    if i >= 3:

        DP[i-3]=0

print((DP[n]))
n, m = list(map(int, input().split()))
A = [int(eval(input())) for i in range(m)]
B = [0 for i in range(10**5 + 10)]
for i in range(len(A)):
    B[A[i]] = 1
mod = 10**9 + 7
DP = [1, 1]
if B[1] == 1:
    DP[1] = 0
for i in range(2, n + 1):
    p1 = DP[i - 2] % mod
    p2 = DP[i - 1] % mod
    if B[i - 2] == 1:
        p1 = 0
    if B[i - 1] == 1:
        p2 = 0
    DP.append((p1 + p2) % mod)
print((DP[n]))

n, m = list(map(int, input().split()))
A = [int(eval(input())) for i in range(m)]
B = [0 for i in range(10**5 + 10)]
for i in range(len(A)):
    B[A[i]] = 1
mod = 10**9 + 7
DP = [1, 1]
if B[1] == 1:
    DP[1] = 0
for i in range(2, n + 1):
    if B[i] == 0:
        DP.append((DP[i - 1] + DP[i - 2]) % mod)
    else:
        DP.append(0)
    if i >= 3:
        DP[i - 3] = 0
print((DP[n]))

-    p1 = DP[i - 2] % mod -    p2 = DP[i - 1] % mod -    if B[i - 2] == 1: -        p1 = 0 -    if B[i - 1] == 1: -        p2 = 0 -    DP.append((p1 + p2) % mod) +    if B[i] == 0: +        DP.append((DP[i - 1] + DP[i - 2]) % mod) +    else: +        DP.append(0) +    if i >= 3: +        DP[i - 3] = 0