import sys
n,m=map(int,input().split())
a=[]
step=[0]*(n+1)
step[0]=1
for i in range(m):
  a.append(int(input()))
for j in range(m-1):
  if a[j+1]-a[j]==1:
    print(0)
    sys.exit()
    
for j in range(n-1):
  if j+1 in a:
    step[j+2]+=step[j]
  else:
    step[j+2]+=2*step[j]
print(step[n]%((10**9)+7))
  