using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static string InputPattern = "InputX";
static List<string> GetInputList()
{
var WillReturn = new List<string>();
if (InputPattern == "Input1") {
WillReturn.Add("0 0 0 4 5 6");
WillReturn.Add("2 3 4 5 6 7");
//Yes
}
else if (InputPattern == "Input2") {
WillReturn.Add("0 0 0 2 2 2");
WillReturn.Add("0 0 2 2 2 4");
//No
}
else if (InputPattern == "Input3") {
WillReturn.Add("0 0 0 1000 1000 1000");
WillReturn.Add("10 10 10 100 100 100");
//Yes
}
else {
string wkStr;
while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
}
return WillReturn;
}
static void Main()
{
List<string> InputList = GetInputList();
int[] wkArr1 = InputList[0].Split(' ').Select(pX => int.Parse(pX)).ToArray();
int StaX1 = wkArr1[0];
int StaY1 = wkArr1[1];
int StaZ1 = wkArr1[2];
int EndX1 = wkArr1[3];
int EndY1 = wkArr1[4];
int EndZ1 = wkArr1[5];
int[] wkArr2 = InputList[1].Split(' ').Select(pX => int.Parse(pX)).ToArray();
int StaX2 = wkArr2[0];
int StaY2 = wkArr2[1];
int StaZ2 = wkArr2[2];
int EndX2 = wkArr2[3];
int EndY2 = wkArr2[4];
int EndZ2 = wkArr2[5];
if (IsNG(StaX1, EndX1, StaX2, EndX2)) { Console.WriteLine("No"); return; }
if (IsNG(StaY1, EndY1, StaY2, EndY2)) { Console.WriteLine("No"); return; }
if (IsNG(StaZ1, EndZ1, StaZ2, EndZ2)) { Console.WriteLine("No"); return; }
Console.WriteLine("Yes");
}
static bool IsNG(int pSta1, int pEnd1, int pSta2, int pEnd2)
{
if (pEnd1 <= pSta2) return true;
if (pEnd2 <= pSta1) return true;
return false;
}
}