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

if as.include?(1)
  patterns = [1, 0]
else
  patterns = [1, 1]
end

(n-1).times do |i|
  if as.include?(i+2)
    patterns << 0
  else
    patterns << (patterns[i] + patterns[i + 1]) % 1000000007
  end
end

# p patterns
puts patterns.last
