N,M = map(int,input().split())
a=[]
for _ in range(M):
    a.append(int(input()))
    
kaidan = [1, 2]

for i in range(2, N):
  kaidan.append(kaidan[i-1]+ kaidan[i-2])

ans = 1

if a[0] - 1 > 0:
    ans *= kaidan[a[0] - 2]
  
for i in range(M-1):
  if((a[i] + 1) > (a[i+1] - 1)):
    ans *= 0
  else:
    ans *= (kaidan[a[i+1] - a[i] - 3])

if N - (a[M - 1] + 1) > 0:
    ans *= kaidan[N - (a[M - 1] + 2)]
print(ans%1000000007)
  