from sys import stdin

def main():
  N, M = map(int, stdin.readline().rstrip().split())
  beforeA=-1
  Mlist=[]

  for i in range(M):
    a = int(stdin.readline().rstrip())
    if (a-beforeA)==1:
      print("0")
      exit()
    Mlist.append(a)
    beforeA = a
      
  if N == 1 or (N == 2 and M==1):
    print("1")
    exit()
  if N == 2:
    print("2")
    exit()

  Mindex=0
  broken=-2
  if len(Mlist) >0:
    broken = Mlist[Mindex]
  an2=0
  an1=1
  patern=0
  brokenNext=False
  for i in range(1,N+1):
    if broken == i:
      Mindex+=1
      if len(Mlist) > Mindex:
        broken = Mlist[Mindex]
      brokenNext=True
      continue
    if brokenNext:
      brokenNext=False
      an2=0
      continue
    patern=(an1+an2)%1000000007
    an2=an1
    an1=patern
    #print("{}: {}".format(i,patern))
  print(patern%1000000007 )

main()
