N,M = map(int,input().split())
a = [int(input()) for _ in range(M)]
k = 10**9+7
dp = [0]*(N+1)
dp[0] = 1
d = 1
if N == 1:
  print(1)
else:
  for i in range(1,N+1):
    if dp[i] == -1:
      continue
    elif i==1:
      dp[i] = d
    elif i==2:
      d += dp[1] if dp[i] != -1 else 0
      dp[i] = d
    else:
      dp1 = dp[i-1] if dp[i-1] != -1 else 0
      dp3 = dp[i-3] if dp[i-3] != -1 else 0
      d = d-dp[i-3]+dp[i-1]
      dp[i] = d
  print(dp[N]%k)