N, M = map(int, input().split())
a = [int(input()) for i in range(M)]
dp = [0]*(N+1)
div = 10**9 + 7
#dp[x] = dp[x-1] + dp[x-2]になる
dp[0] = 1
dp[1] = 1 if a[0] != 1 else 0

for x in range(2, N+1):
  if (x-1 in a and x-2 in a) or (x in a):
    dp[x] = 0
  elif x-1 in a:
    dp[x] = dp[x-2]
  elif x-2 in a:
    dp[x] = dp[x-1]
  else:
    dp[x] = dp[x-1]+dp[x-2]
  dp[x] = dp[x] % div
print(dp[-1]%div)
