# frozen_string_literal: true X, Y = gets.chomp.split.map(&:to_i) _ = gets.to_i AS = gets.chomp.split.map(&:to_i) milestones = [] AS[0..-2].each { |a| milestones << (milestones[-1] || 0) + a } deadlines = [AS[0]] AS[1..-1].each { |a| deadlines << deadlines[-1] + a } deadlines.shift puts(milestones.zip(deadlines).all? { |m, d| m * Y <= X * d } ? 'YES' : 'NO')