ver1 = gets.chomp.split('.') ver2 = gets.chomp.split('.') flag = 1 2.downto(0){|i| flag = ver2[i] > ver1[i] ? 0 : 1} puts flag == 1 ? "YES" : "NO"