def main():
  import sys
  input = sys.stdin.readline
  n,m=map(int,input().split())
  a=[int(input()) for _ in [0]*m]
  mod=pow(10,9)+7
  ans=[0]*n
  ans[0]=1
  for i in range(n):
    if a.count(i+1)==1:
      ans[i]=0
    else:
      if i==1:
        ans[i]=ans[0]+1
      elif i>1:
        if ans[i-1]==0 and ans[i-2]==0:
          print(0)
          exit()
        ans[i]=(ans[i-1]%mod+ans[i-2]%mod)%mod
  print(ans[-1])
if __name__ == '__main__':
    main()