INF = 10 ** 9 + 7

n, m = gets.chomp.split.map(&:to_i)
if n == 1
  puts "1"
  exit
end

a = Array.new(m) { gets.to_i }
dp = Array.new(n + 1, 0)
dp[0] = 1
cur = 0
if a[cur] == 1
  cur += 1
  dp[1] = 0
else
  dp[1] = 1
end

2.step(n) do |i|
  if a[cur] == i
    dp[i] = 0
    cur += 1
  else
    dp[i] = (dp[i - 2] + dp[i - 1]) % INF
  end
end
puts dp[n]