n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
lst=[0]*(n+1)
lst[0]=1;lst[1]=1;lst[2]=2

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

ans=1
for i in range(len(gap)):
    ans*=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]


print(ans%(10**9+7))
