v1 = gets.chomp.split(".").map(&:to_i) v2 = gets.chomp.split(".").map(&:to_i) s1 = "" v1.each do |i| s1 += sprintf("%03d", i) end s2 = "" v2.each do |i| s2 += sprintf("%03d", i) end if s1.to_i >= s2.to_i then puts "YES" else puts "NO" end