n, m = gets.split.map(&:to_i)
as = Array.new(n+10, 1)
m.times do
  a = gets.to_i
  as[a] = 0
end
ss = []
cur = 0
(0..n).each do |i|
  if as[i] == 0 && as[i+1] == 0
    puts 0
    exit
  end

  if as[i] == 1
    cur += 1
  else
    ss << cur unless cur == 0
    cur = 0
  end
end
ss << cur

dp = Array.new(n+10)
dp[0] = 0
dp[1] = 1
(2..n+2).each do |i|
  dp[i] = dp[i-1] + dp[i-2]
end

ans = 1
# puts ss.inspect
# puts dp.inspect
ss.each do |s|
  ans = ans * dp[s] % (10 ** 9 + 7)
end
puts ans
