import strutils, sequtils, math, algorithm

var
  n,m:int
(n,m) = readLine(stdin).split.map(parseInt)
var a = (0..<m).mapIt(readLine(stdin).parseInt)

var b = newSeqWith(n+1,false)
for i in 0..<len(a):
  b[a[i]] = true

var c = newSeqWith(n+1,0)
if not b[0]:
  c[0] = 1

for i in 1..n:
  if b[i]:
    continue
  if i == 1:
    c[i] = c[i-1]
  else:
    c[i] = c[i-1] + c[i-2]

# echo a
# echo b
# echo c
echo c[n] mod 1_000_000_007
