a = gets.chomp.split(".").map(&:to_i) b = gets.chomp.split(".").map(&:to_i) if b[0] <= a[0] and b[1] <= a[1] and b[2] <= a[2] puts "YES" else puts "NO" end