s1 = gets.split(".") s2 = gets.split(".") s1.length.times do |i| if s1[i].to_i < s2[i].to_i puts "NO" exit elsif s1[i].to_i > s2[i].to_i puts "YES" exit end end puts "YES"