N,M=map(int,input().split())
A = []

if M != 0:
  for _ in range(M):
    A.append(int(input()))

#初期化
dp=[0]*N
if A.count(1) == 0:
  dp[0]=1
if A.count(1) == 0 and A.count(2) == 0:
  dp[1]=2
elif A.count(1) ==1 and A.count(2) ==0:
  dp[1]=1

#dp
if N >= 3:
  for i in range(N-2):
    if A.count(i+3) ==1:
      dp[i+2] = 0
    elif A.count(i+1) == 0 and A.count(i+2) == 0:
      dp[i+2] = dp[i+1] + dp[i]
    elif A.count(i+1) == 0 and A.count(i+2) == 1:
      dp[i+2] = dp[i]
    elif A.count(i+1) == 1 and A.count(i+2) == 0:
      dp[i+2] = dp[i+1]
    else:
      dp[i+2] = 0
      
print(dp[N-1]%1000000007)