import numpy as np

a,b=map(int,input().split())
c=[]
for i in range(b):
    c.append(int(input()))
c.append(a+1)    
def Fib(n):
    fib=1/np.sqrt(5)*(((1+np.sqrt(5))/2)**(n)-((1-np.sqrt(5))/2)**(n))
    return(int(fib))

d=[]
z=-1
for j in c:
    di=j-z-1
    if j-z==1:
        print(0)
        exit()
    else:
        d.append(Fib(di))
        z=j
ans=1
for k in d:
    ans=ans*k
print(ans%1000000007)