j = gets.chomp.split(".").map(&:to_i) v = gets.chomp.split(".").map(&:to_i) if v[0] > j[0] puts "NO" elsif v[0] < j[0] puts "YES" else if v[1] > j[1] puts "NO" elsif v[1] < j[1] puts "YES" else puts v[2] > j[2] ? "NO" : "YES" end end