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

A=[]

B=[]

a=[]

a.append(0)

x=0

d=1

A.append(1)

A.append(2)

B.append(1)

B.append(1)

for j in range(2,N):

    A.append(A[j-1]+A[j-2])

    B.append(B[j-1]+B[j-2])

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

    a.append(int(eval(input())))

    if a[i-1]==0:

        if a[i]==1:

            d=1

        else:

            x=A[a[i]-a[i-1]-2]

            d=d*x%(10**9+7)

    else:

        x=B[a[i]-a[i-1]-2]

        d=d*x%(10**9+7)

    if i>1:

        if a[i]-a[i-1]==1:

            d=0

c=N-a[M]

if c==1:

    print(d)

elif c==N:

    x=A[c-1]

    d=d*x%(10**9+7)

    print(d)

else:

    x=A[N-a[M]-2]

    d=d*x%(10**9+7)

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

dp=[1]*(N+1)

for _ in range(M):

    a=int(eval(input()))

    dp[a]=0

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

    if dp[i]!=0:

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

print((dp[N]%(10**9+7)))
N, M = list(map(int, input().split()))
A = []
B = []
a = []
a.append(0)
x = 0
d = 1
A.append(1)
A.append(2)
B.append(1)
B.append(1)
for j in range(2, N):
    A.append(A[j - 1] + A[j - 2])
    B.append(B[j - 1] + B[j - 2])
for i in range(1, M + 1):
    a.append(int(eval(input())))
    if a[i - 1] == 0:
        if a[i] == 1:
            d = 1
        else:
            x = A[a[i] - a[i - 1] - 2]
            d = d * x % (10**9 + 7)
    else:
        x = B[a[i] - a[i - 1] - 2]
        d = d * x % (10**9 + 7)
    if i > 1:
        if a[i] - a[i - 1] == 1:
            d = 0
c = N - a[M]
if c == 1:
    print(d)
elif c == N:
    x = A[c - 1]
    d = d * x % (10**9 + 7)
    print(d)
else:
    x = A[N - a[M] - 2]
    d = d * x % (10**9 + 7)
    print(d)

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

-A = [] -B = [] -a = [] -a.append(0) -x = 0 -d = 1 -A.append(1) -A.append(2) -B.append(1) -B.append(1) -for j in range(2, N): -    A.append(A[j - 1] + A[j - 2]) -    B.append(B[j - 1] + B[j - 2]) -for i in range(1, M + 1): -    a.append(int(eval(input()))) -    if a[i - 1] == 0: -        if a[i] == 1: -            d = 1 -        else: -            x = A[a[i] - a[i - 1] - 2] -            d = d * x % (10**9 + 7) -    else: -        x = B[a[i] - a[i - 1] - 2] -        d = d * x % (10**9 + 7) -    if i > 1: -        if a[i] - a[i - 1] == 1: -            d = 0 -c = N - a[M] -if c == 1: -    print(d) -elif c == N: -    x = A[c - 1] -    d = d * x % (10**9 + 7) -    print(d) -else: -    x = A[N - a[M] - 2] -    d = d * x % (10**9 + 7) -    print(d) +dp = [1] * (N + 1) +for _ in range(M): +    a = int(eval(input())) +    dp[a] = 0 +for i in range(2, N + 1): +    if dp[i] != 0: +        dp[i] = dp[i - 1] + dp[i - 2] +print((dp[N] % (10**9 + 7)))