# https://atcoder.jp/contests/abc129/submissions/5841482 を参考 

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

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

MOD = 10**9 + 7

F = [1]*(N+1)

for j in A:

    F[j-1] = 0

 

a = 1; b = 0

for i in range(N):

    if not F[i]:    #F[i] == 0

        a, b = 0, a

    else:

        a, b = ((a+b) % MOD), a

print(a)
N, M, *A = list(map(int, open(0).read().split()))

MOD = 10**9 + 7

F = [1]*(N+1)

for j in A:

    F[j-1] = 0

 

a = 1; b = 0

for i in range(N):

    if not F[i]:    #F[i] == 0

        a, b = 0, a

    else:

        a, b = ((a+b) % MOD), a

print(a)
# https://atcoder.jp/contests/abc129/submissions/5841482 を参考
N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]
MOD = 10**9 + 7
F = [1] * (N + 1)
for j in A:
    F[j - 1] = 0
a = 1
b = 0
for i in range(N):
    if not F[i]:  # F[i] == 0
        a, b = 0, a
    else:
        a, b = ((a + b) % MOD), a
print(a)

N, M, *A = list(map(int, open(0).read().split()))
MOD = 10**9 + 7
F = [1] * (N + 1)
for j in A:
    F[j - 1] = 0
a = 1
b = 0
for i in range(N):
    if not F[i]:  # F[i] == 0
        a, b = 0, a
    else:
        a, b = ((a + b) % MOD), a
print(a)

-# https://atcoder.jp/contests/abc129/submissions/5841482 を参考 -N, M = list(map(int, input().split())) -A = [int(eval(input())) for _ in range(M)] +N, M, *A = list(map(int, open(0).read().split()))