N, M = gets.split.map(&:to_i)
A = {}
M.times { A[gets.to_i] = true }
MOD = 1000000007

dp = Array.new(N + 1, 0)
dp[0] = 1

1.upto(N) do |i|
  next if A[i]
  dp[i] = dp[i - 1]
  dp[i] += dp[i - 2] if i > 1
  dp[i] %= MOD
end

puts dp[N]
