x_speed, y_speed = gets.split.map(&:to_i) count = gets.chomp.to_i list = gets.split.map(&:to_i) flag = true (count - 1).times do |i| if list[i] * y_speed > list[i + 1] * x_speed break flag = false else flag = true end end if flag puts "YES" else puts "NO" end