OK = "O"
BRO = "B"

N,M=map(int, input().split())
Broken=[int(input()) for i in range(M)]
K = "".join(list(BRO if i in Broken else OK for i in range(N+1)))

if BRO+BRO in K:
  print(0)
else:
  c=[0 for i in range(N+1)]
  if K[N-1]==OK:
    c[1]=1
  if K[N-2]==OK and K[N-1]==OK:
    c[2]=2
  if K[N-2]==OK and K[N-1]==BRO:
    c[2]=1

  for i in range(3,N+1):
    if K[N-i]==OK:
      if K[N-i+1]==OK and K[N-i+2]==OK:
        c[i]=c[i-1]+c[i-2]
      if K[N-i+1]==OK and K[N-i+2]==BRO:
        c[i]=c[i-1]
      if K[N-i+1]==BRO and K[N-i+2]==OK:
        c[i]=c[i-2]
  print(c[N] % 1000000007)
