a = gets.scan(/\d+/).map(&:to_i) b = gets.scan(/\d+/).map(&:to_i) puts (a <=> b) < 0 ? "NO" : "YES"