mod = 1000000007
n, m = gets.split(' ').map(&:to_i)
breaking = Hash.new(false)
m.times { breaking[gets.to_i - 1] = true }
counts = [!breaking[0] ? 1 : 0]
counts.push(!breaking[1] ? counts[0] + 1 : 0)
2.upto(n - 1) do |i|
  if breaking[i]
    counts.push(0)
  else
    counts.push((counts[i - 1] + counts[i - 2]) % mod)
  end
end
puts counts.last