n,m = map(int,input().split())
base = [int(input()) for i in range(m)]
count = 0
now = 0
i= 0
j = 0

dp = [0]*(n+1)
if 1 == base[j]:
  dp[1] = 0
  if j < m-1:
    j = j + 1
else:
  dp[1] = 1

dp[0] = 1

for i in range(2,n+1):
  if not (i == base[j]):
    dp[i] = dp[i-1] + dp[i-2]
  elif i == base[j]:
    if j < m-1:
      j = j+1
  
  
print(int(dp[n]%1000000007))