n,_=gets.split.map(&:to_i)
a=$<.map{|s|s.to_i}
r = Array.new(n+1,0)
r[0] = 1
(1..n).each do |t|
  if a[0] == t
    a.shift
    next
  end
  r[t] = r[t-1] + (t > 1 ? r[t-2] : 0)
end

p r.last % (1000000007)
