fossil = gets.split(".").map(&:to_i) current = gets.split(".").map(&:to_i) for i in 0..2 if fossil[i] > current[i] puts "YES" return elsif fossil[i] < current[i] puts "NO" return else next end end