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] * 20000 + version[1] * 200 + version[2] end end Yukicoder.new