import numpy as np
import sys
N,M = map(int,input().split())
a = [int(input()) for i in range(M)]

def fib(n):
  if n <= 1:
    return 1
  return fib(n-1) +fib(n-2)
  
s = 0
x = 1
for i in range (0,M):
  if s == a[i]:
    print("0")
    sys.exit()
  g = a[i]-1
  x = x * fib(g-s)
  s = g + 2

x = x * fib(N-s)
print(x % 1000000007)