import sys
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
s=n-len(a)*2
S=[1,2]
for i in range(s):
    S.append((S[-1]+S[-2])%1000000007)

step=[]
a=[0]+a+[n]
for i in range(len(a)-1):
    if i==0 and a[1]==1:
        step.append(1)
    elif i==0:
        step.append(S[a[i+1]-a[i]-2])
    elif i==len(a)-2 and a[-2]==n-1:
        step.append(1)
    elif i==len(a)-2:
        step.append(S[a[i+1]-a[i]-2])
    elif a[i+1]-a[i]==1:
        print(0)
        sys.exit()
    else:
        step.append(S[a[i+1]-a[i]-3])

ans=1
for i in step:
    ans*=i
    ans%=1000000007
print(ans)
