n,m = map(int, input().split())
def f(a):
  return round(((((1+5**0.5)/2)**a)-(((1-5**0.5)/2)**a))/5**0.5)
s = 1
a1 = -1
a2 = -1
for i in range(m):
  a2 = int(input())
  if a2 == a1:
    continue
  a = a2-a1-1
  if a <= 1 and a1 > 0:
    s = 0
    break
  s = s * f(a)
  if s >= 1000000007:
    s = s % 1000000007
  a1 = a2
if s > 0:
  a = n - a2
  s = s * f(a)
  if s >= 1000000007:
    s = s % 1000000007
print(s)