n,m=map(int,input().split())
a=[]
for i in range(m):
  a.append(int(input()))
f=[0]*100001
f[0]=0
f[1]=1
f[2]=2
for i in range(3,100001):
  f[i]=f[i-1]+f[i-2]
ans=max(f[a[0]-1],1)
for j in range(m-1):
  ans*=f[a[j+1]-a[j]-2]
print((ans*max(1,f[n-a[-1]-1]))%1000000007)