#!/bin/ruby input = gets.chomp(' ') oldA = input[0].to_i oldB = input[1].to_i oldC = input[2].to_i input = gets.chomp(' ') currentA = input[0].to_i currentB = input[1].to_i currentC = input[2].to_i old = oldA * 10101 + oldB * 101 + oldC current = currentA * 10101 + currentB * 101 + currentC if current <= old puts 'YES' else puts 'NO' end