n, m = gets.split.map(&:to_i)

oks = Array.new(n+1, true)
m.times { oks[gets.to_i] = false }

dp = Array.new(n+1,0)
dp[0] = 1
n.times do |i|
  (i+1..[i+2,n].min).each do |j|
    if oks[j]
      dp[j] += dp[i]
      dp[j] %= 1_000_000_007
    end
  end
end
puts dp[n]
