import sys
def fib(a):
  if a==1:
    return 1
  elif a==0:
    return 1
  else:
    return fib(a-1)+fib(a-2)
def count(a,b):
  if a+1==b:
    return 0
  else:
    return fib(b-a-2)
n,m=map(int,input().split())
a=list(map(int,sys.stdin))
for _ in range(m+1):
  if _ == 0:
    sum = fib(a[_]-1)
  elif _ == m:
    sum = sum*fib(n-a[_-1]-1)%1000000007
  else:
    sum = sum*count(a[_-1],a[_])%1000000007
print(sum)