line = gets.split(' ').map(&:to_i)
n = line[0]
m = line[1]

a = Array.new(m)
m.times do |i|
  a[i] = gets.to_i
end

dp = Array.new(n+2)
dp[0] = 0
dp[1] = 1
for i in 2..n+2
  if a.include?(i-2)
    dp[i] = 0
  else
    dp[i] = dp[i-2] + dp[i-1]
  end

end

if a.include?(0)
  puts 0
else
  puts dp[n+2]%1000000007
end
