n,m=map(int,input().split())
mod=10**9+7
a=[int(input()) for i in range(m)]
lst=[0]*(n+1)
lst[0]=1;lst[1]=1;lst[2]=2
for i in range(3,n+1):
    lst[i]=lst[i-1]+lst[i-2]
    
if m!=0:
    gap=[0]*m
    gap[0]=a[0]-1

    for i in range(1,m):
        gap[i]=a[i]-a[i-1]-2
    gap.append(n-a[-1]-1)
    

    ans=1
    for i in range(len(gap)):
        ans*=lst[gap[i]]
        #print('*',lst[gap[i]])
        ans=ans%(10**9+7)
    
    b=a[0]
    for i in range(1,len(a)):
        if b+1==a[i]:
            ans=0
        b=a[i]
    mod=10**9+7
    print(ans)
else:
    print(lst[n]%mod)
#print(gap)
