MOD = int(1e9 + 7)

N,M = list(map(int, input().split()))
A = []
for i in range(M):
  A.append(int(input()))
  
for i in range(M-1):
  if A[i+1] - A[i] == 1:
    print(0)
    exit(0)
    
dp = [0] * (N+1)
dp[0] = 1
for i in range(N):
  if i-1 < 0 or i-1 in A:
    dp[i+1] = dp[i] % MOD
  elif i in A:
    dp[i+1] = dp[i-1] % MOD
  else:
    dp[i+1] = (dp[i] + dp[i-1]) % MOD
    
print(dp[N])