class Yukicoder def initialize old = encode(gets.chomp.split('.').map(&:to_i)) new = encode(gets.chomp.split('.').map(&:to_i)) puts (old > new)? 'YES' : 'NO' end def encode(version) version[0] * 10000 + version[1] * 100 + version[2] end end Yukicoder.new