N,M=map(int,input().split())
mod=10**9+7
n1=0
n2=0
A=[]
for i in range(M):
  n1=n2
  n2=int(input())
  #print(n2-n1+1)
  A.append(n2-n1-2)
A.append(N-n2-1)
if A[0]==-1:
  A.pop(0)
else:
  A[0]=A[0]+1
#print(A)
mx=max(A)
dp=[0 for i in range(mx+1)]
dp[0]=1
dp[1]=1
for i in range(mx-1):
  dp[i+2]=(dp[i]+dp[i+1])%mod
dp[0]=0
dp.append(0)
#print(dp)
ans=1
for i in range(len(A)):
  ans=(ans*dp[A[i]])%mod
print(ans)