a = gets.split(".").map(&:to_i) b = gets.split(".").map(&:to_i) 3.times do |i| if a[i] > b[i] puts "YES" exit elsif a[i] == b[i] next else puts "NO" exit end end puts "YES"