n, m = gets.chomp.split(' ').map(&:to_i)
arr = Array.new(n)
m.times do
  arr[gets.chomp.to_i] = 0
end

num = n-3
while(num>=0)
  arr[num] = (arr[num+1] + arr[num+2]) % 1_000_000_007
  num-=1
end
puts arr[0]
