import sys

n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
nlist=[]

for i in range(1,m):
  if a[i]-a[i-1]==1:
    print(0)
    sys.exit()
if 1 in a:
  nlist.append(0)
  nlist.append(1)
elif 2 in a:
  nlist.append(1)
  nlist.append(0)
else:
  nlist.append(1)
  nlist.append(2)

for i in range(2,n):
  if i+1 in a:
    nlist.append(0)
  else:
    nlist.append(nlist[i-1]+nlist[i-2])
print(nlist[n-1]%1000000007)