import sequtils, strutils, math, algorithm, tables

var
  nm = readLine(stdin).split().map(parseInt)
  n = nm[0]
  m = nm[1]
  a: seq[int64]
  ans = int64(1)
  now = int64(0)
proc fib(n: int64): int64 =
  var
    num1 = 1
    num2 = 1
    tmp = 1
  for i in 1..<int(n):
    tmp = (num1 + num2) mod (10 ^ 9 + 7)
    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 = int64(ans) * fib(a[^1] - 1 - now)
  now = a[^1] + int64(1)
echo ans * fib(n - now) mod (10 ^ 9 + 7)