import sequtils, strutils, math, algorithm, tables

var
  nm = readLine(stdin).split().map(parseInt)
  n = nm[0]
  m = nm[1]
  a: seq[int]
  ans = 1
  now = 0
proc fib(n: int): int =
  var
    num1 = 1
    num2 = 1
    tmp = 1
  for i in 1..<n:
    tmp = num1 + num2
    num1 = num2
    num2 = tmp
  return tmp
a = @[]
for i in 0..<m:
  a.add(parseInt(readLine(stdin)))
  if a[^1] == now:
    echo 0
    quit()
  ans = ans * fib(a[^1] - 1 - now) mod (10^9+7)
  now = a[^1]+1
echo ans * fib(n - now) mod (10 ^ 9 + 7)