import numpy as np

N, M=map(int, input().split())
A = [int(input()) for i in range(M)]

def fib(n):
    x =np.sqrt(5) 
    return int(1/x * ( ((1+x)/2)**n - ((1-x)/2)**n ) )

before_a=0
output = 1
A.append(N)
for a in A:
    sa = a-before_a
    before_a = a
    output *= fib(sa)

for i in range(len(A)-1):
    if A[i]+1 == A[i+1]:
        output=0
        break
print(output%1000000007)