MOD = (1e+9 + 7).to_i

def chcek(n, m, a)
  (m - 1).times do |i|
    if a[i + 1] - a[i] == 1 then
      return false
    end
  end
  return true
end

def main(argv)
  (n, m) = gets.chomp.split(' ').map(&:to_i)
  
  a = [-1] * m
  m.times {|i| a[i] = gets.chomp.to_i}

  a.uniq!
  m = a.size

  unless chcek(n, m, a) then
    puts 0.to_s
    return
  end
  
  dp = [0] * (n + 2)
  dp[0] = 1
  dp[1] = 1
  n.times do |i|
    dp[i + 2] = dp[i + 1] + dp[i]
  end

  c = 1
  k = 0
  m.times do |i|
    c = (c * dp[(a[i] - 1) - k]) % MOD

    k = a[i] + 1
  end
  c = (c * dp[n - k]) % MOD
  
  puts c.to_s
end

if self.to_s == 'main' then
  main(ARGV)
end