n,m=list(map(int,input().split()))
a=[]
for i in range(m):
    a.append(int(input()))
memo=[0]*100001
memo[1]=1
memo[2]=2
for i in range(3,100001):
    memo[i]=memo[i-1]+memo[i-2]
#残り段数→通り
def step(rem):
    if memo[rem]!=0:
        return memo[rem]
    else:
        return step(rem-1)+step(rem-2)

ans=1
pre=0
for i in a:
    if i==1:
        pre=1
        continue
    if pre==(i-1) and pre!=0:
        print(0)
        exit()
    if i==2:
        pre=2
        continue
    ans*=step(i-pre-2)
    pre=i
ans*=step(n-pre-1)
print(ans%1000000007)