r=input().split()
N=int(r[0])
M=int(r[1])
data_pre=[input() for i in range(M)]
data=[int(s) for s in data_pre]
def func(num):
    if num<=2:
        return 1
    else:
        return int((((1+5**(1/2))/2)**num-((1-5**(1/2))/2)**num)/(5**(1/2)))
if N%2==0 and M>int(N/2):
    print(0)
elif N%2==1 and M>int((N+1)/2):
    print(0)
else:
    ans=1
    mark=0
    if M>=2:
        for i in range(1,M):
            if data[i]-data[i-1]==1:
                ans=0
                mark+=1
                print(ans)
                break
            else:
                x=data[i]-data[i-1]-1
                y=func(x)
                ans=ans*y
    if mark==0:
        x=N-data[M-1]
        y=func(x)
        X=data[0]
        Y=func(X)
        ans=ans*y*Y
        print(ans%(10**9+7))