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

if n==1:
  print(1)
  exit()
if n==2:
  print(2-m)
  exit()
kumiawase = [0 for i in range(n+1)]
kumiawase[0] = 0
kumiawase[1] = 1
kumiawase[2] = 2
for i in range(3,n+1):
  kumiawase[i] = kumiawase[i-2] + kumiawase[i-1]

if m==0:
  print(kumiawase[n])
  exit()
if m==1:
  if a[0]==1 or a[0]==n-1:
    print(kumiawase[n-1])
houhou = 1
if a[0] != 1:
  houhou *= kumiawase[a[0]-1]
houhou %= 1000000007
if a[m-1] != n-1:
  houhou *= kumiawase[n-1-a[m-1]]
houhou %= 1000000007
for i in range(1,m):
  if a[i]-a[i-1]==1:
    print(0)
    exit()
  elif a[i]-a[i-1]==2:
    continue
  houhou *= kumiawase[a[i]-a[i-1]-2]
  houhou %= 1000000007
print(houhou)
