import math
def Fib(n):
  Fib=1/math.sqrt(5)*(((1+math.sqrt(5))/2)**(n+1)-((1-math.sqrt(5))/2)**(n+1))
  return int(Fib)
N,M=map(int,input().split())
if M==0:
  print(Fib(N))
  exit()
A=[]
for i in range(M):
  A.append(int(input()))
B=[0]*M
a=0
for i in range(M):
  B[i]=A[i]-1-a
  a=A[i]+1
B.append(N-a)
a=A[0]
for i in range(1,M):
  if A[i]==a+1:
    print(0)
    exit()
  else:
    a=A[i]
ans=1
for i in range(M+1):
  ans*=Fib(B[i])
print(ans%1000000007)