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]

ans=1
pre=-1
for i in a:
    if i==1:
        pre=1
        continue
    if pre==(i-1):
        print(0)
        exit()
    if i==2:
        pre=2
        continue
    ans*=memo[i-pre-2]
    pre=i
ans*=memo[n-pre-1]
print(ans%1000000007)