n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()))
a.append(n+1)
q=1000000007
def fi(n):
    if n==0:
        return 1
    elif n==1:
        return 1
    elif n==2:
        return 2
    else:
        return fi(n-1)+fi(n-2)
A=[a[0]-1]
temp=0
ans=1
for i in range(1,m+1):
    A.append(a[i]-a[i-1]-2)
    if a[i]-a[i-1]-1==0:
        ans=0
    """if temp<a[i]-a[i-1]-2:
        temp=a[i]-a[i-1]-2
Fi=[0]
for i in range(temp+1):
    Fi.append(fi(n))"""

if ans!=0:
    for i in range(m+1):
        ans*=fi(A[i])
Ans=ans%q
print(Ans)