There is a white sheet of paper lying on a rectangle table. The sheet is a rectangle with its sides parallel to the sides of the table. If you will take a look from above and assume that the bottom left corner of the table has coordinates $(0, 0)$, and coordinate axes are left and bottom sides of the table, then the bottom left corner of the white sheet has coordinates $(x_1, y_1)$, and the top right — $(x_2, y_2)$.

After that two black sheets of paper are placed on the table. Sides of both black sheets are also parallel to the sides of the table. Coordinates of the bottom left corner of the first black sheet are $(x_3, y_3)$, and the top right — $(x_4, y_4)$. Coordinates of the bottom left corner of the second black sheet are $(x_5, y_5)$, and the top right — $(x_6, y_6)$.  [Image] Example of three rectangles. 

Determine if some part of the white sheet can be seen from the above after the two black sheets are placed. The part of the white sheet can be seen if there is at least one point lying not strictly inside the white sheet and strictly outside of both black sheets.


-----Input-----

The first line of the input contains four integers $x_1, y_1, x_2, y_2$ $(0 \le x_1 < x_2 \le 10^{6}, 0 \le y_1 < y_2 \le 10^{6})$ — coordinates of the bottom left and the top right corners of the white sheet.

The second line of the input contains four integers $x_3, y_3, x_4, y_4$ $(0 \le x_3 < x_4 \le 10^{6}, 0 \le y_3 < y_4 \le 10^{6})$ — coordinates of the bottom left and the top right corners of the first black sheet.

The third line of the input contains four integers $x_5, y_5, x_6, y_6$ $(0 \le x_5 < x_6 \le 10^{6}, 0 \le y_5 < y_6 \le 10^{6})$ — coordinates of the bottom left and the top right corners of the second black sheet.

The sides of each sheet of paper are parallel (perpendicular) to the coordinate axes.


-----Output-----

If some part of the white sheet can be seen from the above after the two black sheets are placed, print "YES" (without quotes). Otherwise print "NO".


-----Examples-----
Input
2 2 4 4
1 1 3 5
3 1 5 5

Output
NO

Input
3 3 7 5
0 0 4 6
0 0 7 4

Output
YES

Input
5 2 10 5
3 1 7 6
8 1 11 7

Output
YES

Input
0 0 1000000 1000000
0 0 499999 1000000
500000 0 1000000 1000000

Output
YES



-----Note-----

In the first example the white sheet is fully covered by black sheets.

In the second example the part of the white sheet can be seen after two black sheets are placed. For example, the point $(6.5, 4.5)$ lies not strictly inside the white sheet and lies strictly outside of both black sheets.

Source: codeforces | Difficulty: MEDIUM_HARD
Tags: Geometry

Mathematics


Solutions:
W = list(map(int, input().split()))
B1 = list(map(int, input().split()))
B2 = list(map(int, input().split()))

def f(A, B):
	return (max(A[0], B[0]), max(A[1], B[1]), min(A[2], B[2]), min(A[3], B[3]))

def area(A):
	return max(A[2] - A[0], 0) * max(A[3] - A[1], 0)
if area(f(W, B1)) + area(f(W, B2)) - area(f(W, f(B1, B2))) == area(W):
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
A = [(x1, y1), (x1, y2), (x2, y1), (x2, y2)]
risultato = False
Dentro = [-1, -1, -1, -1]
n = 0
for P in A:
	x = P[0]
	y = P[1]
	if not (x3 <= x <= x4 and y3 <= y <= y4 or (x5 <= x <= x6 and y5 <= y <= y6)):
		risultato = True
		break
	else:
		if x3 <= x <= x4 and y3 <= y <= y4:
			Dentro[n] = 1
		if x5 <= x <= x6 and y5 <= y <= y6:
			Dentro[n] = 2
	n = n + 1
if risultato:
	print('YES')
else:
	x = Dentro[0]
	tuttiinuno = True
	for n in range(4):
		if Dentro[n] != x:
			tuttiinuno = False
			break
		x = Dentro[n]
	if (x4 < x5 or x3 > x6 or y3 > y6 or (y4 < y5)) and (not tuttiinuno):
		print('YES')
	else:
		print('NO')


import itertools

class Rectangle:

	def intersection(self, other):
		(a, b) = (self, other)
		x1 = max(min(a.x1, a.x2), min(b.x1, b.x2))
		y1 = max(min(a.y1, a.y2), min(b.y1, b.y2))
		x2 = min(max(a.x1, a.x2), max(b.x1, b.x2))
		y2 = min(max(a.y1, a.y2), max(b.y1, b.y2))
		if x1 < x2 and y1 < y2:
			return type(self)(x1, y1, x2, y2)
	__and__ = intersection

	def difference(self, other):
		inter = self & other
		if not inter:
			yield self
			return
		xs = {self.x1, self.x2}
		ys = {self.y1, self.y2}
		if self.x1 < other.x1 < self.x2:
			xs.add(other.x1)
		if self.x1 < other.x2 < self.x2:
			xs.add(other.x2)
		if self.y1 < other.y1 < self.y2:
			ys.add(other.y1)
		if self.y1 < other.y2 < self.y2:
			ys.add(other.y2)
		for ((x1, x2), (y1, y2)) in itertools.product(pairwise(sorted(xs)), pairwise(sorted(ys))):
			rect = type(self)(x1, y1, x2, y2)
			if rect != inter:
				yield rect
	__sub__ = difference

	def __init__(self, x1, y1, x2, y2):
		(self.x1, self.y1, self.x2, self.y2) = (x1, y1, x2, y2)

	def __iter__(self):
		yield self.x1
		yield self.y1
		yield self.x2
		yield self.y2

	def __eq__(self, other):
		return isinstance(other, Rectangle) and tuple(self) == tuple(other)

	def __ne__(self, other):
		return not self == other

def pairwise(iterable):
	(a, b) = itertools.tee(iterable)
	next(b, None)
	return zip(a, b)
first_rect = Rectangle(*list(map(lambda x: int(x), input().split(' '))))
second_rect = Rectangle(*list(map(lambda x: int(x), input().split(' '))))
third_rect = Rectangle(*list(map(lambda x: int(x), input().split(' '))))
found = False
diff1 = first_rect - second_rect
for elem in diff1:
	diff2 = elem - third_rect
	for elem2 in diff2:
		if elem2:
			found = True
print('NO' if not found else 'YES')


(a1, b1, a2, b2) = [int(j) for j in input().split()]
(x1, y1, x2, y2) = [int(j) for j in input().split()]
(l1, m1, l2, m2) = [int(j) for j in input().split()]
tot = (a2 - a1) * (b2 - b1)

def overlap(x1, y1, x2, y2, a1, b1, a2, b2):
	return max(min(y2, b2) - max(y1, b1), 0) * max(min(x2, a2) - max(x1, a1), 0)

def overlap_sp(x1, y1, x2, y2, l1, m1, l2, m2, a1, b1, a2, b2):
	return max(min(y2, b2, m2) - max(y1, b1, m1), 0) * max(min(x2, a2, l2) - max(x1, a1, l1), 0)
ov1 = overlap(x1, y1, x2, y2, a1, b1, a2, b2)
ov2 = overlap(l1, m1, l2, m2, a1, b1, a2, b2)
ov3 = overlap_sp(x1, y1, x2, y2, l1, m1, l2, m2, a1, b1, a2, b2)
ov4 = overlap_sp(l1, m1, l2, m2, x1, y1, x2, y2, a1, b1, a2, b2)
tot -= ov1 + ov2
tot += max(ov3, ov4)
if tot == 0:
	print('NO')
else:
	print('YES')


def inter(x1, x2, x3, x4):
	if x1 > x4 or x3 > x2:
		return None
	return (max(x1, x3), min(x2, x4))

def square(rectangle):
	if None in rectangle:
		return 0
	(x1, x2) = rectangle[0]
	(y1, y2) = rectangle[1]
	return abs(x2 - x1) * abs(y2 - y1)
(x1, y1, x2, y2) = [*map(int, input().split())]
(x3, y3, x4, y4) = [*map(int, input().split())]
(x5, y5, x6, y6) = [*map(int, input().split())]
wb1 = (inter(x1, x2, x3, x4), inter(y1, y2, y3, y4))
wb2 = (inter(x1, x2, x5, x6), inter(y1, y2, y5, y6))
if None in wb1 or None in wb2:
	inter_wb_12 = (None, None)
else:
	inter_wb_12 = (inter(wb1[0][0], wb1[0][1], wb2[0][0], wb2[0][1]), inter(wb1[1][0], wb1[1][1], wb2[1][0], wb2[1][1]))
sq = square(((x1, x2), (y1, y2))) - square(wb1) - square(wb2) + square(inter_wb_12)
print('YES' if sq > 0 else 'NO')


(x1, y1, x2, y2) = list(map(int, input().split()))
(x3, y3, x4, y4) = list(map(int, input().split()))
(x5, y5, x6, y6) = list(map(int, input().split()))
a1 = 0
a2 = 0
a3 = 0
if max(x1, x3) < min(x2, x4) and max(y1, y3) < min(y2, y4):
	a1 = abs((max(x1, x3) - min(x2, x4)) * (max(y1, y3) - min(y2, y4)))
if max(x1, x5) < min(x2, x6) and max(y1, y5) < min(y2, y6):
	a2 = abs((max(x1, x5) - min(x2, x6)) * (max(y1, y5) - min(y2, y6)))
(x7, x8, y7, y8) = (max(x5, x3), min(x6, x4), max(y5, y3), min(y6, y4))
if max(x1, x7) < min(x2, x8) and max(y1, y7) < min(y2, y8) and (x8 > x7) and (y8 > y7):
	a3 = abs((max(x1, x7) - min(x2, x8)) * (max(y1, y7) - min(y2, y8)))
if (x2 - x1) * (y2 - y1) - (a1 + a2 - a3):
	print('YES')
else:
	print('NO')


import sys
input = sys.stdin.readline
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
x = list(set([x1, x2, x3, x4, x5, x6]))
y = list(set([y1, y2, y3, y4, y5, y6]))
x.sort()
y.sort()
(xd, yd) = (dict(), dict())
for i in range(len(x)):
	xd[x[i]] = 2 * i
for i in range(len(y)):
	yd[y[i]] = 2 * i
(x1, y1, x2, y2) = (xd[x1], yd[y1], xd[x2], yd[y2])
(x3, y3, x4, y4) = (xd[x3], yd[y3], xd[x4], yd[y4])
(x5, y5, x6, y6) = (xd[x5], yd[y5], xd[x6], yd[y6])
xy = [[0] * 11 for _ in range(11)]
for i in range(x1, x2 + 1):
	for j in range(y1, y2 + 1):
		xy[i][j] += 1
for i in range(x3, x4 + 1):
	for j in range(y3, y4 + 1):
		xy[i][j] += 2
for i in range(x5, x6 + 1):
	for j in range(y5, y6 + 1):
		xy[i][j] += 2
ans = 'NO'
for i in range(11):
	for j in range(11):
		if xy[i][j] == 1:
			ans = 'YES'
print(ans)


import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = prime[1] = False
	r = [p for p in range(n + 1) if prime[p]]
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def calc(n):
	res = 1
	for i in range(n - 2, n + 1):
		res *= i
	return res // 6
(x1, y1, x2, y2) = mi()
(x3, y3, x4, y4) = mi()
(x5, y5, x6, y6) = mi()
if x4 >= x2 and x3 <= x1 and (y4 >= y2) and (y3 <= y1):
	exit(print('NO'))
if x6 >= x2 and x5 <= x1 and (y6 >= y2) and (y5 <= y1):
	exit(print('NO'))
if (y3 <= y6 and y5 < y4 and (y5 <= y1) and (y4 >= y2) or (y3 < y6 and y5 <= y4 and (y3 <= y1) and (y6 >= y2))) and max(x3, x5) <= x1 and (min(x6, x4) >= x2):
	exit(print('NO'))
if (x5 <= x4 and x3 < x6 and (x3 <= x1) and (x6 >= x2) or (x3 <= x6 and x5 < x4 and (x5 <= x1) and (x4 >= x2))) and max(y3, y5) <= y1 and (min(y4, y6) >= y2):
	exit(print('NO'))
print('YES')


def its(x1, y1, x2, y2, x3, y3, x4, y4):
	x = min(x4, x2) - max(x1, x3)
	y = min(y4, y2) - max(y1, y3)
	if x <= 0 or y <= 0:
		return 0
	return x * y

def solve():
	split = str.split
	(x1, y1, x2, y2) = map(int, split(input()))
	(x3, y3, x4, y4) = map(int, split(input()))
	(x5, y5, x6, y6) = map(int, split(input()))
	sum = 0
	S1 = (x2 - x1) * (y2 - y1)
	sum += its(x1, y1, x2, y2, x3, y3, x4, y4) + its(x1, y1, x2, y2, x5, y5, x6, y6)
	x = min(min(x2, x4), min(x2, x6)) - max(max(x1, x3), max(x1, x5))
	y = min(min(y2, y4), min(y2, y6)) - max(max(y1, y3), max(y1, y5))
	if x > 0 and y > 0:
		sum -= x * y
	if sum == S1:
		print('NO')
	else:
		print('YES')
solve()


import sys

class Rect:

	def __init__(self, is_input=True):
		if is_input:
			(self.x1, self.y1, self.x2, self.y2) = map(int, input().split())

	def area(self):
		return (self.x2 - self.x1) * (self.y2 - self.y1)

def findIntersection(q, p):
	area = 0
	y_intersection = max(min(q.y2, p.y2) - max(q.y1, p.y1), 0)
	if y_intersection:
		x_intersection = max(min(q.x2, p.x2) - max(q.x1, p.x1), 0)
		area = y_intersection * x_intersection
	return area
recs = []
for _ in range(3):
	recs.append(Rect())
i1 = findIntersection(recs[0], recs[1])
i2 = findIntersection(recs[0], recs[2])
i3 = findIntersection(recs[1], recs[2])
i = 0
if i3 > 0:
	overlap = Rect(is_input=False)
	overlap.x1 = max(recs[1].x1, recs[2].x1)
	overlap.y1 = max(recs[1].y1, recs[2].y1)
	overlap.x2 = min(recs[1].x2, recs[2].x2)
	overlap.y2 = min(recs[1].y2, recs[2].y2)
	i = findIntersection(overlap, recs[0])
if i1 + i2 - i >= recs[0].area():
	print('NO')
else:
	print('YES')


[x1, y1, x2, y2] = [int(x) for x in input().split()]
[x3, y3, x4, y4] = [int(x) for x in input().split()]
[x5, y5, x6, y6] = [int(x) for x in input().split()]
no = 'NO'
yes = 'YES'

def ries(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6):
	if x3 <= x1 and y3 <= y1 and (x4 >= x2) and (y4 >= y2):
		return no
	if x5 <= x1 and y5 <= y1 and (x6 >= x2) and (y6 >= y2):
		return no
	if x3 <= x1 and y3 <= y1 and (x4 >= x5) and (y4 >= y2) and (y5 <= y1) and (x6 >= x2) and (y6 >= y2):
		return no
	if x5 <= x1 and y5 <= y1 and (x6 >= x3) and (y6 >= y2) and (y3 <= y1) and (x4 >= x2) and (y4 >= y2):
		return no
	if x3 <= x1 and y3 <= y1 and (x4 >= x2) and (y4 >= y5) and (x5 <= x1) and (x6 >= x2) and (y6 >= y2):
		return no
	if x5 <= x1 and y5 <= y1 and (x6 >= x2) and (y6 >= y3) and (x3 <= x1) and (x4 >= x2) and (y4 >= y2):
		return no
	return yes
print(ries(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6))


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
A = (x2 - x1) * (y2 - y1)
if x5 >= x2 or x6 <= x1:
	areaa = 0
elif y5 >= y2 or y6 <= y1:
	areaa = 0
else:
	a1 = max(x1, x5)
	b1 = max(y1, y5)
	c1 = min(x2, x6)
	d1 = min(y2, y6)
	areaa = abs((c1 - a1) * (d1 - b1))
if x3 >= x2 or x4 <= x1:
	areab = 0
elif y3 >= y2 or y4 <= y1:
	areab = 0
else:
	a2 = max(x1, x3)
	b2 = max(y1, y3)
	c2 = min(x2, x4)
	d2 = min(y2, y4)
	areab = abs((c2 - a2) * (d2 - b2))
if areaa * areab == 0:
	ea = areaa + areab
elif a1 >= c2 or c1 <= a2 or b1 >= d2 or (d1 <= b2):
	ea = areaa + areab
else:
	a3 = max(a1, a2)
	b3 = max(b1, b2)
	c3 = min(c1, c2)
	d3 = min(d1, d2)
	ea = areaa + areab - abs((c3 - a3) * (d3 - b3))
if ea == A:
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())

def inn(x, y, x1, y1, x2, y2):
	if x >= x1 and x < x2 and (y >= y1) and (y < y2):
		return 1
	else:
		return 0
z1 = inn(x1, y1, x3, y3, x4, y4)
z2 = inn(x1, y2 - 1, x3, y3, x4, y4)
z3 = inn(x2 - 1, y2 - 1, x3, y3, x4, y4)
z4 = inn(x2 - 1, y1, x3, y3, x4, y4)
z5 = inn(x1, y1, x5, y5, x6, y6)
z6 = inn(x1, y2 - 1, x5, y5, x6, y6)
z7 = inn(x2 - 1, y2 - 1, x5, y5, x6, y6)
z8 = inn(x2 - 1, y1, x5, y5, x6, y6)
if z1 + z2 + z3 + z4 > 2:
	print('NO')
elif z5 + z6 + z7 + z8 > 2:
	print('NO')
elif max(z1, z5) + max(z2, z6) + max(z3, z7) + max(z4, z8) < 4:
	print('YES')
else:
	if z1 == 1 and z2 == 1:
		if x4 >= x5:
			print('NO')
		else:
			print('YES')
	if z2 == 1 and z3 == 1:
		if y3 <= y6:
			print('NO')
		else:
			print('YES')
	if z3 == 1 and z4 == 1:
		if x3 <= x6:
			print('NO')
		else:
			print('YES')
	if z4 == 1 and z1 == 1:
		if y4 >= y5:
			print('NO')
		else:
			print('YES')


def frange(start, stop, step=1):
	while start < stop:
		yield start
		start += step
(x1, y1, x2, y2) = list(map(int, input().split(' ')))
(x3, y3, x4, y4) = list(map(int, input().split(' ')))
(x5, y5, x6, y6) = list(map(int, input().split(' ')))
if x3 < x1:
	x3 = x1
if x5 < x1:
	x5 = x1
if y3 < y1:
	y3 = y1
if y5 < y1:
	y5 = y1
if x4 > x2:
	x4 = x2
if x6 > x2:
	x6 = x2
if y4 > y2:
	y4 = y2
if y6 > y2:
	y6 = y2
if x3 >= x2 or x4 <= x1:
	x3 = x4 = 0
if x5 >= x2 or x6 <= x1:
	x5 = x6 = 0
if y3 >= y2 or y4 <= y1:
	y3 = y4 = 0
if y5 >= y2 or y6 <= y1:
	y5 = y6 = 0
s1 = (x4 - x3) * (y4 - y3)
s2 = (x6 - x5) * (y6 - y5)
sall = (x2 - x1) * (y2 - y1)
moshtartkx = max([x3, x5])
moshtartkx2 = min([x4, x6])
moshtartky = max([y3, y5])
moshtartky2 = min([y4, y6])
if s1 and s2:
	s3 = abs(moshtartkx - moshtartkx2) * abs(moshtartky - moshtartky2)
else:
	s3 = 0
if s1 + s2 - s3 >= sall:
	print('NO')
else:
	print('YES')


(x1_w, y1_w, x2_w, y2_w) = map(int, input().split())
(x1_b1, y1_b1, x2_b1, y2_b1) = map(int, input().split())
(x1_b2, y1_b2, x2_b2, y2_b2) = map(int, input().split())
result = 'YES'
if x1_b1 <= x1_w and y1_b1 <= y1_w and (x2_b1 >= x2_w) and (y2_b1 >= y2_w) or (x1_b2 <= x1_w and y1_b2 <= y1_w and (x2_b2 >= x2_w) and (y2_b2 >= y2_w)):
	result = 'NO'
if x1_b1 <= x1_w and y1_b1 <= y1_w and (x2_b1 >= x2_b2) and (y2_b1 >= y1_b2) and (x1_b2 <= x1_w) and (x2_b2 >= x2_w) and (y2_b2 >= y2_w) or (x1_b2 <= x1_w and y1_b2 <= y1_w and (x2_b2 >= x2_b1) and (y2_b2 >= y1_b1) and (x1_b1 <= x1_w) and (x2_b1 >= x2_w) and (y2_b1 >= y2_w)):
	result = 'NO'
if x1_b1 <= x1_w and y1_b1 <= y1_w and (y2_b1 >= y2_w) and (x2_b1 >= x1_b2) and (x2_b2 >= x2_w) and (y2_b2 >= y2_w) and (y1_b2 <= y1_w) or (x1_b2 <= x1_w and y1_b2 <= y1_w and (y2_b2 >= y2_w) and (x2_b2 >= x1_b1) and (x2_b1 >= x2_w) and (y2_b1 >= y2_w) and (y1_b1 <= y1_w)):
	result = 'NO'
print(result)


(x1, y1, x2, y2) = list(map(int, input().split()))
(x3, y3, x4, y4) = list(map(int, input().split()))
(x5, y5, x6, y6) = list(map(int, input().split()))
f = False
if x3 <= x1 <= x4 and x3 <= x2 <= x4:
	if y3 <= y1 <= y4 and y3 <= y2 <= y4:
		f = True
	elif y1 < y3 <= y2 <= y4:
		y2 = y3
	elif y3 <= y1 <= y4 < y2:
		y1 = y4
if y3 <= y1 <= y4 and y3 <= y2 <= y4:
	if x3 <= x1 <= x4 and x3 <= x2 <= x4:
		f = True
	elif x1 < x3 <= x2 <= x4:
		x2 = x3
	elif x3 <= x1 <= x4 < x2:
		x1 = x4
if x5 <= x1 <= x6 and x5 <= x2 <= x6:
	if y5 <= y1 <= y6 and y5 <= y2 <= y6:
		f = True
print('NO' if f else 'YES')


def R():
	(x, y, u, v) = map(int, input().split())
	return (-x, -y, u, v)
x = lambda a, b: [*map(min, a, b)]
s = lambda x, y, u, v: max(0, x + u) * max(0, y + v)
(a, b, c) = (R(), R(), R())
d = x(a, b)
print('YNEOS'[s(*a) == s(*d) + s(*x(a, c)) - s(*x(d, c))::2])


def overlaps(x1, y1, x2, y2, x3, y3, x4, y4):
	(l, r) = (0, 0)
	if x3 >= x1 and x3 <= x2:
		l = x3
	elif x3 < x1:
		l = x1
	else:
		return (-1, -1, -1, -1)
	if x4 >= x1 and x4 <= x2:
		r = x4
	elif x4 > x2:
		r = x2
	else:
		return (-1, -1, -1, -1)
	(b, t) = (0, 0)
	if y3 >= y1 and y3 <= y2:
		b = y3
	elif y3 < y1:
		b = y1
	else:
		return (-1, -1, -1, -1)
	if y4 >= y1 and y4 <= y2:
		t = y4
	elif y4 > y2:
		t = y2
	else:
		return (-1, -1, -1, -1)
	assert l <= r
	assert b <= t
	return (l, b, r, t)
assert overlaps(5, 5, 10, 10, 5, 5, 10, 10) == (5, 5, 10, 10)
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
(x3, y3, x4, y4) = overlaps(x1, y1, x2, y2, x3, y3, x4, y4)
(x5, y5, x6, y6) = overlaps(x1, y1, x2, y2, x5, y5, x6, y6)
(x7, y7, x8, y8) = overlaps(x3, y3, x4, y4, x5, y5, x6, y6)
a1 = (x4 - x3) * (y4 - y3)
a2 = (x6 - x5) * (y6 - y5)
a3 = (x8 - x7) * (y8 - y7)
total = (x2 - x1) * (y2 - y1)
if a1 + a2 - a3 >= total:
	print('NO')
else:
	print('YES')


w = [x for x in map(int, input().split(' '))]
b_1 = [x for x in map(int, input().split(' '))]
b_2 = [x for x in map(int, input().split(' '))]

def cover(a, b):
	left = max(a[0], b[0])
	bot = max(a[1], b[1])
	right = min(a[2], b[2])
	top = min(a[3], b[3])
	return [left, bot, right, top]

def area(a):
	if a[0] < a[2] and a[1] < a[3]:
		return (a[2] - a[0]) * (a[3] - a[1])
	else:
		return 0
if area(cover(w, b_1)) + area(cover(w, b_2)) - area(cover(cover(w, b_1), b_2)) == area(w):
	print('NO')
else:
	print('YES')


w = list(map(int, input().split()))
b1 = list(map(int, input().split()))
b2 = list(map(int, input().split()))

def find(a, b):
	return (max(a[0], b[0]), max(a[1], b[1]), min(a[2], b[2]), min(a[3], b[3]))

def area(a):
	return max(a[2] - a[0], 0) * max(a[3] - a[1], 0)
if area(find(w, b1)) + area(find(w, b2)) - area(find(w, find(b1, b2))) == area(w):
	print('NO')
else:
	print('YES')


a = [*map(int, input().split())]
b = [*map(int, input().split())]
c = [*map(int, input().split())]
ab = [0] * 4
ab[0] = max(a[0], b[0])
ab[2] = min(a[2], b[2])
ab[1] = max(a[1], b[1])
ab[3] = min(a[3], b[3])
if ab == a:
	print('NO')
	exit(0)
ac = [0] * 4
ac[0] = max(a[0], c[0])
ac[2] = min(a[2], c[2])
ac[1] = max(a[1], c[1])
ac[3] = min(a[3], c[3])
if ac == a:
	print('NO')
	exit(0)
if ab[0] >= ab[2] or ab[1] >= ab[3] or ac[0] >= ac[2] or (ac[1] >= ac[3]):
	print('YES')
	exit(0)
abac = [0] * 4
abac[0] = max(ab[0], ac[0])
abac[2] = min(ab[2], ac[2])
abac[1] = max(ab[1], ac[1])
abac[3] = min(ab[3], ac[3])
oo = (ab[2] - ab[0]) * (ab[3] - ab[1]) + (ac[2] - ac[0]) * (ac[3] - ac[1])
if abac[0] >= abac[2] or abac[1] >= abac[3]:
	oo -= 0
else:
	oo -= (abac[2] - abac[0]) * (abac[3] - abac[1])
if oo >= (a[2] - a[0]) * (a[3] - a[1]):
	print('NO')
else:
	print('YES')


def intersect(c1, c2):
	l = max(c1[0], c2[0])
	r = min(c1[2], c2[2])
	if l >= r:
		return [0, 0, 0, 0]
	d = max(c1[1], c2[1])
	u = min(c1[3], c2[3])
	if d >= u:
		return [0, 0, 0, 0]
	return [l, d, r, u]

def sq(c):
	return abs(c[2] - c[0]) * abs(c[3] - c[1])
w = list(map(int, input().split()))
b1 = list(map(int, input().split()))
b2 = list(map(int, input().split()))
ans = sq(w) - sq(intersect(w, b1)) - sq(intersect(w, b2)) + sq(intersect(intersect(w, b1), intersect(w, b2)))
if ans > 0:
	print('YES')
else:
	print('NO')


def inter(a, b):
	c = []
	c.append(max(a[0], b[0]))
	c.append(max(a[1], b[1]))
	c.append(min(a[2], b[2]))
	c.append(min(a[3], b[3]))
	return c

def area(a):
	return max(a[2] - a[0], 0) * max(a[3] - a[1], 0)
a = list(map(int, input().strip().split()))
b = list(map(int, input().strip().split()))
c = list(map(int, input().strip().split()))
d = area(inter(a, b))
e = area(inter(a, c))
f = area(inter(a, inter(b, c)))
if d + e - f == area(a):
	print('NO')
else:
	print('YES')


c = lambda s: [(s[0 if i & 1 else 2], s[1 if i & 2 else 3]) for i in range(4)]
ins = lambda p, s: s[0] <= p[0] <= s[2] and s[1] <= p[1] <= s[3]
w = list(map(int, input().split()))
b = [list(map(int, input().split())) for _ in '12']
cn = [set((i for (i, p) in enumerate(c(w)) if ins(p, s))) for s in b]
if len(cn[0] | cn[1]) < 4:
	print('YES')
elif any((len(x) == 4 for x in cn)):
	print('NO')
else:
	print('YES' if any((min(b[0][2 + i], b[1][2 + i]) < max(b[0][i], b[1][i]) for i in (0, 1))) else 'NO')


def is_inside_rect(px, py, rx1, ry1, rx2, ry2):
	return rx1 <= px <= rx2 and ry1 <= py <= ry2

def solve():
	(x1, y1, x2, y2) = map(int, input().split())
	(x3, y3, x4, y4) = map(int, input().split())
	(x5, y5, x6, y6) = map(int, input().split())
	if not is_inside_rect(x1, y1, x3, y3, x4, y4) and (not is_inside_rect(x1, y1, x5, y5, x6, y6)) or (not is_inside_rect(x1, y2, x3, y3, x4, y4) and (not is_inside_rect(x1, y2, x5, y5, x6, y6))) or (not is_inside_rect(x2, y1, x3, y3, x4, y4) and (not is_inside_rect(x2, y1, x5, y5, x6, y6))) or (not is_inside_rect(x2, y2, x3, y3, x4, y4) and (not is_inside_rect(x2, y2, x5, y5, x6, y6))):
		print('YES')
		exit(0)
	i = x1
	mid_y = y1 + (y2 - y1) / 2
	while i <= x2:
		if not is_inside_rect(i, mid_y, x3, y3, x4, y4) and (not is_inside_rect(i, mid_y, x5, y5, x6, y6)):
			print('YES')
			exit(0)
		i += 0.5
	i = y1
	mid_x = x1 + (x2 - x1) / 2
	while i <= y2:
		if not is_inside_rect(mid_x, i, x3, y3, x4, y4) and (not is_inside_rect(mid_x, i, x5, y5, x6, y6)):
			print('YES')
			exit(0)
		i += 0.5
	print('NO')
solve()


(x1, y1, x2, y2) = map(int, input().split(' '))
(x3, y3, x4, y4) = map(int, input().split(' '))
(x5, y5, x6, y6) = map(int, input().split(' '))
four_points = [[x1, y1], [x1, y2], [x2, y1], [x2, y2]]
in_all = True
for (x, y) in four_points:
	if not (x3 <= x <= x4 and y3 <= y <= y4 or (x5 <= x <= x6 and y5 <= y <= y6)):
		in_all = False
		break
cond1 = not in_all
if x4 < x5 and x1 <= x4 and (x5 <= x2):
	cond2 = True
elif x6 < x3 and x1 <= x6 and (x3 <= x2):
	cond2 = True
elif y4 < y5 and y1 <= y4 and (y5 <= y2):
	cond2 = True
elif y6 < y3 and y1 <= y6 and (y3 <= y2):
	cond2 = True
else:
	cond2 = False
out = 'YES' if cond1 or cond2 else 'NO'
print(out)


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())

def per(a):
	(x1, y1, x2, y2, x3, y3, x4, y4) = (a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7])
	left = max(x1, x3)
	right = min(x2, x4)
	top = min(y2, y4)
	bottom = max(y1, y3)
	if left > right or bottom > top:
		return [0, 0, 0, 0]
	return [left, bottom, right, top]

def s(a):
	(x1, y1, x2, y2) = (a[0], a[1], a[2], a[3])
	return (x2 - x1) * (y2 - y1)
s1 = s(per([x1, y1, x2, y2, x3, y3, x4, y4]))
s2 = s(per([x1, y1, x2, y2, x5, y5, x6, y6]))
s3 = s(per([x1, y1, x2, y2] + per([x3, y3, x4, y4, x5, y5, x6, y6])))
if s1 + s2 - s3 >= s([x1, y1, x2, y2]):
	print('NO')
else:
	print('YES')


import sys
w = [int(i) for i in input().split()]
b1 = [int(i) for i in input().split()]
b2 = [int(i) for i in input().split()]

def is_inside(r_in, r_out):
	return r_out[0] <= r_in[0] <= r_out[2] and r_out[1] <= r_in[1] <= r_out[3] and (r_out[0] <= r_in[2] <= r_out[2]) and (r_out[1] <= r_in[3] <= r_out[3])

def bisects(r_in, r_out):
	return r_out[0] <= r_in[0] <= r_out[2] and r_out[0] <= r_in[2] <= r_out[2] or (r_out[1] <= r_in[1] <= r_out[3] and r_out[1] <= r_in[3] <= r_out[3])
if is_inside(w, b1) or is_inside(w, b2):
	print('NO')
	sys.exit(0)
if b1[0] <= w[0] <= b1[2] and b1[0] <= w[2] <= b1[2]:
	if b1[1] <= w[1] <= b1[3]:
		w[1] = b1[3]
	elif b1[1] <= w[3] <= b1[3]:
		w[3] = b1[1]
elif b1[1] <= w[1] <= b1[3] and b1[1] <= w[3] <= b1[3]:
	if b1[0] <= w[0] <= b1[2]:
		w[0] = b1[2]
	elif b1[0] <= w[2] <= b1[2]:
		w[2] = b1[0]
elif b2[0] <= w[0] <= b2[2] and b2[0] <= w[2] <= b2[2]:
	if b2[1] <= w[1] <= b2[3]:
		w[1] = b2[3]
	elif b2[1] <= w[3] <= b2[3]:
		w[3] = b2[1]
elif b2[1] <= w[1] <= b2[3] and b2[1] <= w[3] <= b2[3]:
	if b2[0] <= w[0] <= b2[2]:
		w[0] = b2[2]
	elif b2[0] <= w[2] <= b2[2]:
		w[2] = b2[0]
if is_inside(w, b1) or is_inside(w, b2):
	print('NO')
	sys.exit(0)
print('YES')


def intersection(a, b):
	return [max(a[0], b[0]), max(a[1], b[1]), min(a[2], b[2]), min(a[3], b[3])]

def area(a):
	return max(a[2] - a[0], 0) * max(a[3] - a[1], 0)
w = list(map(int, input().split()))
b1 = list(map(int, input().split()))
b2 = list(map(int, input().split()))
d = area(intersection(w, b1))
e = area(intersection(w, b2))
g = area(intersection(w, intersection(b1, b2)))
if d + e - g == area(w):
	print('NO')
else:
	print('YES')


def do_overlap(l1_x, l1_y, r1_x, r1_y, l2_x, l2_y, r2_x, r2_y):
	if l1_x > r2_x or l2_x > r1_x:
		return False
	if l1_y < r2_y or l2_y < r1_y:
		return False
	return True

def isRectangleOverlap(rec1, rec2):
	return not (rec1[2] < rec2[0] or rec1[3] < rec2[1] or rec1[0] > rec2[2] or (rec1[1] > rec2[3]))

def get_intersection(x1, y1, x2, y2, x3, y3, x4, y4):
	if isRectangleOverlap([x1, y1, x2, y2], [x3, y3, x4, y4]):
		x5 = max(x1, x3)
		y5 = max(y1, y3)
		x6 = min(x2, x4)
		y6 = min(y2, y4)
		return [x5, y5, x6, y6]
	else:
		return None

def check_set(x, y, white, point_corner):
	for i in range(1, 4, 2):
		x1 = white[i - 1]
		y1 = white[i]
		if x == x1 and y == y1:
			point_corner[x, y] = True
	x1 = white[0]
	y1 = white[3]
	if x == x1 and y == y1:
		point_corner[x, y] = True
	x1 = white[2]
	y1 = white[1]
	if x == x1 and y == y1:
		point_corner[x, y] = True

def union_is_rectangle(rect1, rect2, white):
	point_corner = dict()
	point_corner[white[0], white[1]] = False
	point_corner[white[2], white[3]] = False
	point_corner[white[0], white[3]] = False
	point_corner[white[2], white[1]] = False
	if rect1 and rect2:
		if not isRectangleOverlap(rect1, rect2):
			print('YES')
			return
	if rect1:
		rect1.extend((rect1[0], rect1[3], rect1[2], rect1[1]))
		for i in range(1, len(rect1), 2):
			check_set(rect1[i - 1], rect1[i], white, point_corner)
	if rect2:
		rect2.extend((rect2[0], rect2[3], rect2[2], rect2[1]))
		for i in range(1, len(rect2), 2):
			check_set(rect2[i - 1], rect2[i], white, point_corner)
	for e in point_corner.values():
		if not e:
			print('YES')
			return
	print('NO')
white = list(map(int, input().split()))
black_1 = list(map(int, input().split()))
black_2 = list(map(int, input().split()))
rect1 = get_intersection(white[0], white[1], white[2], white[3], black_1[0], black_1[1], black_1[2], black_1[3])
rect2 = get_intersection(white[0], white[1], white[2], white[3], black_2[0], black_2[1], black_2[2], black_2[3])
union_is_rectangle(rect1, rect2, white)


(x1, y1, x2, y2) = list(map(int, input().split()))
(x3, y3, x4, y4) = list(map(int, input().split()))
(x5, y5, x6, y6) = list(map(int, input().split()))
ans = 'YES'
if x3 <= x1 and y3 <= y1 and (x4 >= x2) and (y4 >= y2):
	ans = 'NO'
if x5 <= x1 and y5 <= y1 and (x6 >= x2) and (y6 >= y2):
	ans = 'NO'
if y4 >= y2 and y5 <= y1 and (x5 <= x1) and (x6 >= x2) and (x3 <= x1) and (x4 >= x2) and (y3 <= y6):
	ans = 'NO'
if y6 >= y2 and y3 <= y1 and (x3 <= x1) and (x4 >= x2) and (x5 <= x1) and (x6 >= x2) and (y5 <= y4):
	ans = 'NO'
if x4 >= x2 and x5 <= x1 and (y5 <= y1) and (y6 >= y2) and (y3 <= y1) and (y4 >= y2) and (x3 <= x6):
	ans = 'NO'
if x6 >= x2 and x3 <= x1 and (y3 <= y1) and (y4 >= y2) and (y5 <= y1) and (y6 >= y2) and (x5 <= x4):
	ans = 'NO'
print(ans)


def main():
	(x1, y1, x2, y2) = map(int, input().split())
	(x3, y3, x4, y4) = map(int, input().split())
	(x5, y5, x6, y6) = map(int, input().split())
	ans = 'NO'
	for x in range(x1, x2 + 1):
		if not (x3 <= x <= x4 and y3 <= y1 <= y4) and (not (x5 <= x <= x6 and y5 <= y1 <= y6)):
			ans = 'YES'
		if not (x3 <= x <= x4 and y3 <= y2 <= y4) and (not (x5 <= x <= x6 and y5 <= y2 <= y6)):
			ans = 'YES'
		if x == x2:
			continue
		x += 0.5
		if not (x3 <= x <= x4 and y3 <= y1 <= y4) and (not (x5 <= x <= x6 and y5 <= y1 <= y6)):
			ans = 'YES'
		if not (x3 <= x <= x4 and y3 <= y2 <= y4) and (not (x5 <= x <= x6 and y5 <= y2 <= y6)):
			ans = 'YES'
	for y in range(y1, y2 + 1):
		if not (x3 <= x1 <= x4 and y3 <= y <= y4) and (not (x5 <= x1 <= x6 and y5 <= y <= y6)):
			ans = 'YES'
		if not (x3 <= x2 <= x4 and y3 <= y <= y4) and (not (x5 <= x2 <= x6 and y5 <= y <= y6)):
			ans = 'YES'
		if y == y2:
			continue
		y += 0.5
		if not (x3 <= x1 <= x4 and y3 <= y <= y4) and (not (x5 <= x1 <= x6 and y5 <= y <= y6)):
			ans = 'YES'
		if not (x3 <= x2 <= x4 and y3 <= y <= y4) and (not (x5 <= x2 <= x6 and y5 <= y <= y6)):
			ans = 'YES'
	print(ans)
main()


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
s = 'YES'
if x3 <= x1 and y3 <= y1 and (x4 >= x2) and (y4 >= y2):
	s = 'NO'
elif x5 <= x1 and y5 <= y1 and (x6 >= x2) and (y6 >= y2):
	s = 'NO'
elif y3 <= y1 and y4 >= y2 and (x4 >= x2) and (y5 <= y1) and (y6 >= y2) and (x5 <= x1) and (x6 >= x3):
	s = 'NO'
elif y5 <= y1 and y6 >= y2 and (x6 >= x2) and (y3 <= y1) and (y4 >= y2) and (x3 <= x1) and (x4 >= x5):
	s = 'NO'
elif x3 <= x1 and x4 >= x2 and (y3 <= y1) and (x5 <= x1) and (x6 >= x2) and (y6 >= y2) and (y5 <= y4):
	s = 'NO'
elif x5 <= x1 and x6 >= x2 and (y5 <= y1) and (x3 <= x1) and (x4 >= x2) and (y4 >= y2) and (y3 <= y6):
	s = 'NO'
print(s)


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if x2 - x1 <= x4 - x3 and x3 <= x1 and (x4 >= x2) and (y2 - y1 <= y4 - y3) and (y3 <= y1) and (y4 >= y2):
	print('NO')
elif x2 - x1 <= x6 - x5 and x5 <= x1 and (x6 >= x2) and (y2 - y1 <= y6 - y5) and (y5 <= y1) and (y6 >= y2):
	print('NO')
elif x1 >= x3 and x1 >= x5 and (max(x3, x5) <= min(x4, x6)) and (x2 <= x4) and (x2 <= x6) and (y1 >= min(y3, y5)) and (max(y3, y5) <= min(y4, y6)) and (y2 <= max(y4, y6)):
	print('NO')
elif x1 >= min(x3, x5) and max(x3, x5) <= min(x4, x6) and (x2 <= max(x4, x6)) and (y1 >= y3) and (y1 >= y5) and (max(y3, y5) <= min(y4, y6)) and (y2 <= y4) and (y2 <= y6):
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
(p1, p2, p3, p4) = (max(x5, x1), min(x2, x6), max(y5, y1), min(y6, y2))
(p11, p12, p13, p14) = (max(x1, x3), min(x2, x4), max(y1, y3), min(y2, y4))
(p21, p22, p23, p24) = (max(p1, p11), min(p2, p12), max(p3, p13), min(p4, p14))
if p1 < p2 and p3 < p4:
	s13 = (p2 - p1) * (p4 - p3)
else:
	s13 = 0
if p11 < p12 and p13 < p14:
	s12 = (p12 - p11) * (p14 - p13)
else:
	s12 = 0
if p21 < p22 and p23 < p24:
	s23 = (p22 - p21) * (p24 - p23)
else:
	s23 = 0
sp = s13 + s12 - s23
if sp >= (x2 - x1) * (y2 - y1):
	print('NO')
else:
	print('YES')


import sys
import collections

def ri(flag=0):
	if flag == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
Re = collections.namedtuple('Rectangle', 'BottomX BottomY RigthY LetX')

def area(a, b):
	dx = min(a.RigthY, b.RigthY) - max(a.BottomX, b.BottomX)
	dy = min(a.LetX, b.LetX) - max(a.BottomY, b.BottomY)
	if dx >= 0 and dy >= 0:
		return dx * dy
	else:
		return 0

def take(a, b):
	XRight = min(a.RigthY, b.RigthY)
	Xleft = max(a.BottomX, b.BottomX)
	ZZ = 1
	ZZ += 1
	ZZ -= 1
	Yright = min(a.LetX, b.LetX)
	Yleft = max(a.BottomY, b.BottomY)
	return Re(Xleft, Yleft, XRight, Yright)
a = ri()
a = Re(a[0], a[1], a[2], a[3])
b = ri()
b = Re(b[0], b[1], b[2], b[3])
c = ri()
c = Re(c[0], c[1], c[2], c[3])
first = area(a, b)
two = area(a, c)
t11 = take(a, b)
t12 = take(a, c)
three = area(t11, t12)
if abs(a[0] - a[2]) * abs(a[1] - a[3]) - first - two + three > 0:
	print('YES')
else:
	print('NO')


def f(a, b):
	xl = max(a[0], b[0])
	yl = max(a[1], b[1])
	xr = min(a[2], b[2])
	yr = min(a[3], b[3])
	return (xl, yl, xr, yr)

def s(a):
	return max(a[2] - a[0], 0) * max(a[3] - a[1], 0)
w = tuple(map(int, input().split()))
b1 = tuple(map(int, input().split()))
b2 = tuple(map(int, input().split()))
print('NO' if s(f(w, b1)) + s(f(w, b2)) - s(f(f(b1, b2), w)) == s(w) else 'YES')


(x1, y1, x2, y2) = list(map(int, input().split()))
for _ in range(2):
	(a, b, c, d) = list(map(int, input().split()))
	if x1 >= a and x2 <= c:
		if y1 >= b:
			y1 = max(y1, d)
		if y2 <= d:
			y2 = min(y2, b)
	if y1 >= b and y2 <= d:
		if x1 >= a:
			x1 = max(x1, c)
		if x2 <= c:
			x2 = min(x2, a)
if x1 >= x2 and y1 >= y2:
	print('NO')
else:
	print('YES')


w = input()
b1 = input()
b2 = input()
(x1, y1, x2, y2) = [int(_) for _ in w.split()]
(x3, y3, x4, y4) = [int(_) for _ in b1.split()]
(x5, y5, x6, y6) = [int(_) for _ in b2.split()]
ccc = None
if x3 <= x1 and y3 <= y1 and (x4 >= x2) and (y4 >= y2):
	ccc = 'NO'
elif ccc is None and x5 <= x1 and (y5 <= y1) and (x6 >= x2) and (y6 >= y2):
	ccc = 'NO'
elif ccc is None and (x3 <= x1 and x4 >= x2) and (x5 <= x1 and x6 >= x2):
	mn = min(y3, y5)
	mx = max(y4, y6)
	if mn <= y1 and mx >= y2:
		if min(y4, y6) < max(y3, y5):
			if y3 <= y1 <= y2 <= y4 or y5 <= y1 <= y2 <= y6:
				ccc = 'NO'
			else:
				ccc = 'YES'
		else:
			ccc = 'NO'
elif ccc is None and (y3 <= y1 and y4 >= y2) and (y5 <= y1 and y6 >= y2):
	mn = min(x3, x5)
	mx = max(x4, x6)
	if mn <= x1 and mx >= x2:
		if min(x4, x6) < max(x3, x5):
			if x3 <= x1 <= x2 <= x4 or x5 <= x1 <= x2 <= x6:
				ccc = 'NO'
			else:
				ccc = 'YES'
		else:
			ccc = 'NO'
if ccc is None:
	ccc = 'YES'
print(ccc)


def solve():
	(x1, y1, x2, y2) = map(int, input().split())
	(x3, y3, x4, y4) = map(int, input().split())
	(x5, y5, x6, y6) = map(int, input().split())
	if x3 <= x1 and x2 <= x4 and (not (y4 <= y1 or y3 >= y2)):
		if y3 <= y1:
			y1 = y4 + 0.1
		elif y4 >= y2:
			y2 = y3 - 0.1
	if y3 <= y1 and y4 >= y2 and (not (x4 <= x1 or x3 >= x2)):
		if x3 <= x1:
			x1 = x4 + 0.1
		elif x4 >= x2:
			x2 = x3 - 0.1
	if x5 <= x1 and x6 >= x2 and (not (y6 <= y1 or y5 >= y2)):
		if y5 <= y1:
			y1 = y6 + 0.1
		elif y6 >= y2:
			y2 = y5 - 0.1
	if y5 <= y1 and y6 >= y2 and (not (x6 <= x1 or x5 >= x2)):
		if x5 <= x1:
			x1 = x6 + 0.1
		elif x6 >= x2:
			x2 = x5 - 0.1
	if x1 > x2 or y1 > y2:
		print('NO')
	else:
		print('YES')
solve()


import sys
input = sys.stdin.readline
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())

def cut(x1, y1, x2, y2, x3, y3, x4, y4):
	if x3 <= x1 and x2 <= x4:
		if y3 <= y1 <= y4:
			y1 = min(y2, y4)
		if y3 <= y2 <= y4:
			y2 = max(y1, y3)
	if y3 <= y1 and y2 <= y4:
		if x3 <= x1 <= x4:
			x1 = min(x2, x4)
		if x3 <= x2 <= x4:
			x2 = max(x1, x3)
	return (x1, y1, x2, y2)
(x1, y1, x2, y2) = cut(x1, y1, x2, y2, x3, y3, x4, y4)
(x1, y1, x2, y2) = cut(x1, y1, x2, y2, x5, y5, x6, y6)
if x1 == x2 or y1 == y2:
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
d = 0
if x3 < x1:
	x3 = x1
if x5 < x1:
	x5 = x1
if y3 < y1:
	y3 = y1
if y5 < y1:
	y5 = y1
if x4 > x2:
	x4 = x2
if x6 > x2:
	x6 = x2
if y4 > y2:
	y4 = y2
if y6 > y2:
	y6 = y2
if x4 < x1:
	(x3, y3, x4, y4) = (x1, x1, x1, x1)
if y4 < y1:
	(x3, y3, x4, y4) = (x1, x1, x1, x1)
if x5 > x2:
	(x5, y5, x6, y6) = (x1, x1, x1, x1)
if y5 > y2:
	(x5, y5, x6, y6) = (x1, x1, x1, x1)
if x6 < x1:
	(x5, y5, x6, y6) = (x1, x1, x1, x1)
if y6 < y1:
	(x5, y5, x6, y6) = (x1, x1, x1, x1)
if x3 > x2:
	(x3, y3, x4, y4) = (x1, x1, x1, x1)
if y3 > y2:
	(x3, y3, x4, y4) = (x1, x1, x1, x1)
if x3 <= x5 and y3 <= y5 and (x4 >= x6) and (y4 >= y6):
	d = (x6 - x5) * (y6 - y5)
elif x5 <= x3 and y5 <= y3 and (x6 >= x4) and (y6 >= y4):
	d = (x4 - x3) * (y4 - y3)
elif (x4 >= x5 and y4 >= y5) and (x3 <= x5 and y3 <= y5):
	d = (x4 - x5) * (y4 - y5)
elif (x6 >= x3 and y6 >= y3) and (x5 <= x3 and y5 <= y3):
	d = (x6 - x3) * (y6 - y3)
s = (x2 - x1) * (y2 - y1)
s1 = (x4 - x3) * (y4 - y3)
s2 = (x6 - x5) * (y6 - y5)
if s + d - s1 - s2 > 0 or (x3 != x1 and y5 != y1) or (x5 != x1 and y3 != y1):
	print('Yes')
else:
	print('NO')


from math import *
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if x3 < x1:
	x3 = x1
if x4 > x2:
	x4 = x2
if y3 < y1:
	y3 = y1
if y4 > y2:
	y4 = y2
if x5 < x1:
	x5 = x1
if x6 > x2:
	x6 = x2
if y5 < y1:
	y5 = y1
if y6 > y2:
	y6 = y2
if x3 >= x2 or x4 <= x1:
	x3 = x4
if y3 >= y2 or y4 <= y1:
	y3 = y4
if x5 > x2 or x6 <= x1:
	x5 = x6
if y5 > y2 or y6 < y1:
	y5 = y6
a1 = (x4 - x3) * (y4 - y3)
a2 = (x6 - x5) * (y6 - y5)
a = (x2 - x1) * (y2 - y1)
k = max(x3, x5)
m = min(x4, x6)
z = max(y3, y5)
n = min(y4, y6)
if a1 > 0 and a2 > 0:
	a3 = abs(m - k) * abs(n - z)
else:
	a3 = 0
if a1 + a2 - a3 >= a:
	print('NO')
else:
	print('YES')


def inside(x1, y1, x2, y2, x3, y3, x4, y4):
	return x3 <= x1 <= x4 and y3 <= y1 <= y4 and (x3 <= x2 <= x4) and (y3 <= y2 <= y4)
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
ok = False
if inside(x1, y1, x2, y2, x3, y3, x4, y4) or inside(x1, y1, x2, y2, x5, y5, x6, y6):
	ok = True
if y3 <= y1 <= y4 and y3 <= y2 <= y4 and (x3 <= x1 <= x4) and (y5 <= y1 <= y6) and (y5 <= y2 <= y6) and (x5 <= x2 <= x6) and (x5 <= x4):
	ok = True
if y3 <= y1 <= y4 and y3 <= y2 <= y4 and (x3 <= x2 <= x4) and (y5 <= y1 <= y6) and (y5 <= y2 <= y6) and (x5 <= x1 <= x6) and (x3 <= x6):
	ok = True
if x3 <= x1 <= x4 and x3 <= x2 <= x4 and (y3 <= y1 <= y4) and (x5 <= x1 <= x6) and (x5 <= x2 <= x6) and (y5 <= y2 <= y6) and (y5 <= y4):
	ok = True
if x3 <= x1 <= x4 and x3 <= x2 <= x4 and (y3 <= y2 <= y4) and (x5 <= x1 <= x6) and (x5 <= x2 <= x6) and (y5 <= y1 <= y6) and (y3 <= y6):
	ok = True
if ok:
	print('NO')
else:
	print('YES')


def getCommon(a, b, c, d):
	if b <= c or d <= a:
		return (0, 0)
	else:
		e = min(abs(b - c), abs(a - d), abs(b - a), abs(d - c))
		if e == abs(b - c):
			return (min(b, c), max(b, c))
		elif e == abs(a - d):
			return (min(a, d), max(a, d))
		elif e == abs(b - a):
			return (min(b, a), max(b, a))
		else:
			return (min(d, c), max(d, c))

def process(A, B, C):
	(q1, w1) = getCommon(A[0][0], A[1][0], B[0][0], B[1][0])
	(z1, x1) = getCommon(A[0][1], A[1][1], B[0][1], B[1][1])
	s1 = (w1 - q1) * (x1 - z1)
	(q2, w2) = getCommon(A[0][0], A[1][0], C[0][0], C[1][0])
	(z2, x2) = getCommon(A[0][1], A[1][1], C[0][1], C[1][1])
	s2 = (w2 - q2) * (x2 - z2)
	(a, b) = getCommon(q1, w1, C[0][0], C[1][0])
	(c, d) = getCommon(z1, x1, C[0][1], C[1][1])
	s3 = (b - a) * (d - c)
	if (A[1][0] - A[0][0]) * (A[1][1] - A[0][1]) - s1 - s2 + s3 > 0:
		print('YES')
	else:
		print('NO')
A = []
for i in range(3):
	(a, b, c, d) = [int(x) for x in input().split()]
	A.append([[a, b], [c, d]])
process(A[0], A[1], A[2])


Q = 'NO'
P = input
O = int
N = map
(A, B, D, C) = N(O, P().split())
(G, H, E, I) = N(O, P().split())
(J, K, F, L) = N(O, P().split())
M = 'YES'
if G <= A and H <= B and (E >= D) and (I >= C) or (J <= A and K <= B and (F >= D) and (L >= C)):
	M = Q
if G <= A and H <= B and (E >= F) and (I >= K) and (J <= A) and (F >= D) and (L >= C) or (J <= A and K <= B and (F >= E) and (L >= H) and (G <= A) and (E >= D) and (I >= C)):
	M = Q
if G <= A and H <= B and (I >= C) and (E >= J) and (F >= D) and (L >= C) and (K <= B) or (J <= A and K <= B and (L >= C) and (F >= G) and (E >= D) and (I >= C) and (H <= B)):
	M = Q
print(M)


a = list(map(int, input().split()))
(x1, y1, x2, y2) = (a[0], a[1], a[2], a[3])
a = list(map(int, input().split()))
(x3, y3, x4, y4) = (a[0], a[1], a[2], a[3])
a = list(map(int, input().split()))
(x5, y5, x6, y6) = (a[0], a[1], a[2], a[3])
l1 = l2 = l3 = l4 = 1
if x1 >= x5 and x2 <= x6 and (y1 >= y5) and (y1 <= y6) or (x1 >= x3 and x2 <= x4 and (y1 >= y3) and (y1 <= y4)) or (y1 >= y5 and y1 <= y6 and (y1 >= y3) and (y1 <= y4) and (x1 >= min(x3, x5)) and (x2 <= max(x4, x6)) and (x4 >= x5) and (x3 <= x6)):
	l1 = 0
if y1 >= y5 and y2 <= y6 and (x1 >= x5) and (x1 <= x6) or (y1 >= y3 and y2 <= y4 and (x1 >= x3) and (x1 <= x4)) or (x1 >= x5 and x1 <= x6 and (x1 >= x3) and (x1 <= x4) and (y1 >= min(y3, y5)) and (y2 <= max(y4, y6)) and (y4 >= y5) and (y3 <= y6)):
	l2 = 0
if x1 >= x5 and x2 <= x6 and (y2 >= y5) and (y2 <= y6) or (x1 >= x3 and x2 <= x4 and (y2 >= y3) and (y2 <= y4)) or (y2 >= y5 and y2 <= y6 and (y2 >= y3) and (y2 <= y4) and (x1 >= min(x3, x5)) and (x2 <= max(x4, x6)) and (x4 >= x5) and (x3 <= x6)):
	l3 = 0
if y1 >= y5 and y2 <= y6 and (x2 >= x5) and (x2 <= x6) or (y1 >= y3 and y2 <= y4 and (x2 >= x3) and (x2 <= x4)) or (x2 >= x5 and x2 <= x6 and (x2 >= x3) and (x2 <= x4) and (y1 >= min(y3, y5)) and (y2 <= max(y4, y6)) and (y4 >= y5) and (y3 <= y6)):
	l4 = 0
if l1 or l2 or l3 or l4:
	print('YES')
else:
	print('NO')


class Rect:

	def __init__(self, x1, y1, x2, y2):
		self.x1 = int(x1)
		self.y1 = int(y1)
		self.x2 = int(x2)
		self.y2 = int(y2)
		self.width = abs(self.x2 - self.x1)
		self.height = abs(self.y2 - self.y1)
		self.area = self.width * self.height

def overlap(r1, r2):
	olap_x = max(min(r1.x2, r2.x2) - max(r1.x1, r2.x1), 0)
	olap_y = max(min(r1.y2, r2.y2) - max(r1.y1, r2.y1), 0)
	if olap_x * olap_y > 0:
		return Rect(max(r1.x1, r2.x1), max(r1.y1, r2.y1), min(r1.x2, r2.x2), min(r1.y2, r2.y2))
	else:
		return Rect(0, 0, 0, 0)
white = Rect(*input().split())
black1 = Rect(*input().split())
black2 = Rect(*input().split())
b1_olap = overlap(white, black1)
b2_olap = overlap(white, black2)
olap_olap = overlap(b1_olap, b2_olap)
if white.area - b1_olap.area - b2_olap.area + olap_olap.area > 0:
	print('YES')
else:
	print('NO')


import sys

def rint():
	return map(int, sys.stdin.readline().split())
xl = 0
yb = 1
xr = 2
yt = 3

def ov_rect(wr, br):
	oxl = max(wr[xl], br[xl])
	oxr = min(wr[xr], br[xr])
	oyb = max(wr[yb], br[yb])
	oyt = min(wr[yt], br[yt])
	if oxr >= oxl and oyt >= oyb:
		return [oxl, oyb, oxr, oyt]
	else:
		return [-1, -1, -2, -2]

def rec_area(r):
	return (r[xr] - r[xl] + 1) * (r[yt] - r[yb] + 1)

def is_border(r1, r2):
	if r1[xr] == r2[xl] - 1 or r2[xr] == r1[xl] - 1:
		return True
	if r1[yt] == r2[yb] - 1 or r2[yt] == r1[yb] - 1:
		return True
	return False
wr = list(rint())
br1 = list(rint())
br2 = list(rint())
ov1 = ov_rect(wr, br1)
ov2 = ov_rect(wr, br2)
ov12 = ov_rect(ov1, ov2)
br_ov_tot = rec_area(ov1) + rec_area(ov2) - rec_area(ov12)
wr_area = rec_area(wr)
if br_ov_tot == wr_area:
	if is_border(ov1, ov2):
		print('Yes')
	else:
		print('NO')
else:
	print('YES')


white_coord = list(map(int, input().split()))
black_1_coord = list(map(int, input().split()))
black_2_coord = list(map(int, input().split()))
x1 = white_coord[0]
y1 = white_coord[1]
x2 = white_coord[2]
y2 = white_coord[3]
x3 = black_1_coord[0]
y3 = black_1_coord[1]
x4 = black_1_coord[2]
y4 = black_1_coord[3]
x5 = black_2_coord[0]
y5 = black_2_coord[1]
x6 = black_2_coord[2]
y6 = black_2_coord[3]
can_be_seen = 'NO'
if x1 < x3:
	x7 = x1
	y7 = y1
	x8 = min(x2, x3)
	y8 = y2
	if x7 < x5 or y7 < y5 or x8 > x6 or (y8 > y6):
		can_be_seen = 'YES'
if x2 > x4:
	x9 = max(x1, x4)
	y9 = y1
	x10 = x2
	y10 = y2
	if x9 < x5 or y9 < y5 or x10 > x6 or (y10 > y6):
		can_be_seen = 'YES'
if y1 < y3:
	x11 = x1
	y11 = y1
	x12 = x2
	y12 = min(y2, y3)
	if x11 < x5 or y11 < y5 or x12 > x6 or (y12 > y6):
		can_be_seen = 'YES'
if y2 > y4:
	x13 = x1
	y13 = max(y1, y4)
	x14 = x2
	y14 = y2
	if x13 < x5 or y13 < y5 or x14 > x6 or (y14 > y6):
		can_be_seen = 'YES'
print(can_be_seen)


x = []
for i in range(3):
	a = list(map(int, input().split()))
	x.append(a)

def ok(a, b, n):
	nonlocal x
	return x[n][0] <= a <= x[n][2] and x[n][1] <= b <= x[n][3]

def kol(n):
	nonlocal x
	t = 0
	x1 = x[0][0]
	y1 = x[0][1]
	x2 = x[0][2]
	y2 = x[0][3]
	if ok(x1, y1, n):
		t += 1
	if ok(x1, y2, n):
		t += 1
	if ok(x2, y1, n):
		t += 1
	if ok(x2, y2, n):
		t += 1
	return t
k1 = kol(1)
k2 = kol(2)

def ooo():
	x1 = x[0][0]
	y1 = x[0][1]
	x2 = x[0][2]
	y2 = x[0][3]
	t = True
	t = t and (ok(x1, y1, 1) or ok(x1, y1, 2))
	t = t and (ok(x1, y2, 1) or ok(x1, y2, 2))
	t = t and (ok(x2, y1, 1) or ok(x2, y1, 2))
	t = t and (ok(x2, y2, 1) or ok(x2, y2, 2))
	return t
if k1 == 4 or k2 == 4:
	print('NO')
elif k1 + k2 < 4:
	print('YES')
elif not ooo():
	print('YES')
else:
	x1 = x[0][0]
	y1 = x[0][1]
	x2 = x[0][2]
	y2 = x[0][3]
	if ok(x1, y1, 2):
		(x[1], x[2]) = (x[2], x[1])
	if ok(x2, y1, 1):
		if x[1][3] >= x[2][1]:
			print('NO')
		else:
			print('YES')
	elif x[1][2] >= x[2][0]:
		print('NO')
	else:
		print('YES')


w = [int(ele) for ele in input().split()]
b1 = [int(ele) for ele in input().split()]
b2 = [int(ele) for ele in input().split()]
if b1[0] <= w[0] and b1[1] <= w[1] and (b1[2] >= w[2]) and (b1[3] >= w[3]):
	print('NO')
elif b2[0] <= w[0] and b2[1] <= w[1] and (b2[2] >= w[2]) and (b2[3] >= w[3]):
	print('NO')
elif b1[0] <= w[0] and b1[1] <= w[1] and (b1[2] >= w[2]) and (b1[3] <= w[3]):
	if b2[0] <= w[0] and b2[1] <= b1[3] and (b2[2] >= w[2]) and (b2[3] >= w[3]):
		print('NO')
	else:
		print('YES')
elif b2[0] <= w[0] and b2[1] <= w[1] and (b2[2] >= w[2]) and (b2[3] <= w[3]):
	if b1[0] <= w[0] and b1[1] <= b2[3] and (b1[2] >= w[2]) and (b1[3] >= w[3]):
		print('NO')
	else:
		print('YES')
elif b1[0] <= w[0] and b1[1] <= w[1] and (b1[2] <= w[2]) and (b1[3] >= w[3]):
	if b2[0] <= b1[2] and b2[1] <= w[1] and (b2[2] >= w[2]) and (b2[3] >= w[3]):
		print('NO')
	else:
		print('YES')
elif b2[0] <= w[0] and b2[1] <= w[1] and (b2[2] <= w[2]) and (b2[3] >= w[3]):
	if b1[0] <= b2[2] and b1[1] <= w[1] and (b1[2] >= w[2]) and (b1[3] >= w[3]):
		print('NO')
	else:
		print('YES')
else:
	print('YES')


import sys
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7

def compress(S):
	(zipped, unzipped) = ({}, {})
	for (i, a) in enumerate(sorted(S)):
		zipped[a] = i
		unzipped[i] = a
	return (zipped, unzipped)
XY = []
S = set()
for i in range(3):
	(x1, y1, x2, y2) = MAP()
	XY.append((x1, y1, x2, y2))
	S.add(x1)
	S.add(y1)
	S.add(x2)
	S.add(y2)
(zipped, _) = compress(S)
N = len(zipped)
for i in range(3):
	(x1, y1, x2, y2) = XY[i]
	XY[i] = (zipped[x1], zipped[y1], zipped[x2], zipped[y2])
imos = list2d(N + 1, N + 1, 0)
for (x1, y1, x2, y2) in XY[1:]:
	imos[x1][y1] += 1
	imos[x2][y1] -= 1
	imos[x1][y2] -= 1
	imos[x2][y2] += 1
for i in range(N):
	imos[i] = list(accumulate(imos[i]))
for j in range(N):
	for i in range(N - 1):
		imos[i + 1][j] += imos[i][j]
(x1, y1, x2, y2) = XY[0]
for x in range(x1, x2):
	for y in range(y1, y2):
		if not imos[x][y]:
			YES()
			exit()
NO()


from functools import reduce
NULL = (None, None)

def L(x1, x2) -> int:
	global NULL
	if (x1, x2) == NULL:
		return 0
	return abs(x1 - x2)

def segment_intersection(seg1, seg2) -> tuple:
	global NULL
	if seg1 == NULL or seg2 == NULL:
		return NULL
	(x1, x2) = seg1
	(x3, x4) = seg2
	if x1 > x2:
		(x1, x2) = (x2, x1)
	if x3 > x4:
		(x3, x4) = (x4, x3)
	minx = min(x1, x3)
	maxx = max(x2, x4)
	if L(x1, x2) + L(x3, x4) >= L(minx, maxx):
		return (max(x1, x3), min(x2, x4))
	return NULL

def proj(box, axis) -> tuple:
	((x1, y1), (x2, y2)) = box
	if axis == 'x':
		return (x1, x2)
	elif axis == 'y':
		return (y1, y2)

def area(box) -> int:
	((x1, y1), (x2, y2)) = box
	projx = proj(box, 'x')
	projy = proj(box, 'y')
	a = L(*projx)
	b = L(*projy)
	return a * b

def box_intersection(*boxes) -> tuple:
	global NULL

	def projx(box):
		return proj(box, 'x')

	def projy(box):
		return proj(box, 'y')
	intersect = segment_intersection
	boxes_projections_on_x = map(projx, boxes)
	boxes_projections_on_y = map(projy, boxes)
	x = intersection_x = reduce(intersect, boxes_projections_on_x)
	y = intersection_y = reduce(intersect, boxes_projections_on_y)
	if x != NULL and y != NULL:
		A = down_left_corner = (min(x), min(y))
		B = upper_right_corner = (max(x), max(y))
		intersection_box = (A, B)
	else:
		intersection_box = (NULL, NULL)
	return intersection_box

def create_box_from_coordinates(text):
	(x1, x2, x3, x4) = map(int, text.split())
	box = ((x1, x2), (x3, x4))
	return box

def solution():
	box1 = create_box_from_coordinates(input())
	box2 = create_box_from_coordinates(input())
	box3 = create_box_from_coordinates(input())
	box12 = box_intersection(box1, box2)
	box13 = box_intersection(box1, box3)
	box123 = box_intersection(box1, box2, box3)
	if area(box12) + area(box13) - area(box123) < area(box1):
		print('YES')
	else:
		print('NO')
solution()


from sys import setrecursionlimit as SRL, stdin
SRL(10 ** 7)
rd = stdin.readline
rrd = lambda : map(int, rd().strip().split())
(x1, y1, x2, y2) = rrd()
(x3, y3, x4, y4) = rrd()
(x5, y5, x6, y6) = rrd()

def is_in(x, y):
	return x[0] <= y[0] and x[1] >= y[1]

def seg(x, y):
	if x[1] <= y[1] and x[0] <= y[0]:
		return (max(y[0], x[1]), y[1])
	elif x[0] >= y[0] and x[1] >= y[1]:
		return (y[0], min(x[0], y[1]))
	else:
		return y

def is_lay(x, y):
	if is_in((x[0], x[2]), (y[0], y[2])):
		if is_in((x[1], x[3]), (y[1], y[3])):
			return (2, (1, 1, 1, 1))
		s = seg((x[1], x[3]), (y[1], y[3]))
		return (1, (y[0], s[0], y[2], s[1]))
	elif is_in((x[1], x[3]), (y[1], y[3])):
		s = seg((x[0], x[2]), (y[0], y[2]))
		return (1, (s[0], y[1], s[1], y[3]))
	return (0, y)

def is_cover(x, y):
	return is_in((x[0], x[2]), (y[0], y[2])) and is_in((x[1], x[3]), (y[1], y[3]))
p_y = is_lay((x3, y3, x4, y4), (x1, y1, x2, y2))
if p_y[0] == 2:
	print('NO')
	exit(0)
if is_cover((x5, y5, x6, y6), p_y[1]):
	print('NO')
else:
	print('YES')


a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

def inside(one):
	return a[0] >= one[0] and a[1] >= one[1] and (a[2] <= one[2]) and (a[3] <= one[3])

def x_cover(one, two):
	return one[0] <= a[0] and one[2] >= a[2] and (one[3] >= a[3]) and (two[0] <= a[0]) and (two[2] >= a[2]) and (two[1] <= a[1]) and (two[3] >= one[1])

def y_cover(one, two):
	return one[0] <= a[0] and one[1] <= a[1] and (one[3] >= a[3]) and (two[0] <= a[2]) and (two[3] >= a[3]) and (two[1] <= a[1]) and (two[2] >= a[2]) and (one[2] >= two[0])
if inside(b) or inside(c):
	print('NO')
elif x_cover(b, c) or x_cover(c, b):
	print('NO')
elif y_cover(b, c) or y_cover(c, b):
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
pl = (x2 - x1) * (y2 - y1)

def peresech(a, b, c, d, a2, b2, c2, d2):
	l1 = [a, c, a2, c2]
	l2 = [b, d, b2, d2]
	l1.sort()
	l2.sort()
	if a == a2 and b == b2 and (c == c2) and (d == d2):
		return [a, b, c, d]
	if b > d2 or c < a2 or d < b2 or (a > c2):
		return 0
	return [l1[1], l2[1], l1[2], l2[2]]
l = peresech(x1, y1, x2, y2, x3, y3, x4, y4)
l2 = peresech(x1, y1, x2, y2, x5, y5, x6, y6)
if l == 0:
	if l2 != 0:
		if (l2[2] - l2[0]) * (l2[3] - l2[1]) != pl:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')
	exit()
if l2 == 0 and l != 0:
	if (l[2] - l[0]) * (l[3] - l[1]) != pl:
		print('YES')
	else:
		print('NO')
	exit()
l3 = peresech(l[0], l[1], l[2], l[3], l2[0], l2[1], l2[2], l2[3])
if l3 == 0:
	if (l[2] - l[0]) * (l[3] - l[1]) + (l2[2] - l2[0]) * (l2[3] - l2[1]) == pl:
		print('NO')
	else:
		print('YES')
	exit()
if (l[2] - l[0]) * (l[3] - l[1]) + (l2[2] - l2[0]) * (l2[3] - l2[1]) - (l3[2] - l3[0]) * (l3[3] - l3[1]) == pl:
	print('NO')
else:
	print('YES')


class Rect:

	def __init__(self, x1, y1, x2, y2):
		self.x1 = x1
		self.y1 = y1
		self.x2 = x2
		self.y2 = y2

	def __str__(self):
		return f'{self.x1} {self.y1} {self.x2} {self.y2}'

	def xs(self):
		return [self.x1, self.x2]

	def ys(self):
		return [self.y1, self.y2]

	def is_contained(self, x, y):
		return float(self.x1) <= x <= float(self.x2) and float(self.y1) <= y <= float(self.y2)

def test_for_white(x1, y1, w, b1, b2):
	if not w.is_contained(x1, y1):
		return False
	if b1.is_contained(x1, y1) or b2.is_contained(x1, y1):
		return False
	return True

def main():
	(x1, y1, x2, y2) = [int(s) for s in input().split()]
	w = Rect(x1, y1, x2, y2)
	(x1, y1, x2, y2) = [int(s) for s in input().split()]
	b1 = Rect(x1, y1, x2, y2)
	(x1, y1, x2, y2) = [int(s) for s in input().split()]
	b2 = Rect(x1, y1, x2, y2)
	xs = w.xs() + b1.xs() + b2.xs()
	ys = w.ys() + b1.ys() + b2.ys()
	xss = list(sorted(set(xs)))
	yss = list(sorted(set(ys)))
	for xi in range(len(xss) - 1):
		for yi in range(len(yss) - 1):
			if test_for_white(xss[xi] + 0.5, yss[yi] + 0.5, w, b1, b2):
				print('YES')
				return
	print('NO')
main()


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
base_x = [x1, x2]
base_y = [y1, y2]
if x3 <= x1 and x2 <= x6 and (y3 <= y1 and y2 <= y4) and (y5 <= y1 and y2 <= y6):
	if x1 <= x5 <= x4 <= x2:
		print('NO')
		exit()
if x5 <= x1 and x2 <= x4 and (y3 <= y1 and y2 <= y4) and (y5 <= y1 and y2 <= y6):
	if x1 <= x3 <= x6 <= x2:
		print('NO')
		exit()
if y3 <= y1 and y2 <= y6 and (x3 <= x1 and x2 <= x4) and (x5 <= x1 and x2 <= x6):
	if y1 <= y5 <= y4 <= y2:
		print('NO')
		exit()
if y5 <= y1 and y2 <= y4 and (x3 <= x1 and x2 <= x4) and (x5 <= x1 and x2 <= x6):
	if y1 <= y3 <= y6 <= y2:
		print('NO')
		exit()
if x3 <= x1 and x2 <= x4 and (y3 <= y1) and (y2 <= y4):
	print('NO')
	exit()
if x5 <= x1 and x2 <= x6 and (y5 <= y1) and (y2 <= y6):
	print('NO')
	exit()
print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if x1 < x3 and x1 < x5 or (y1 < y3 and y1 < y5) or (x2 > x4 and x2 > x6) or (y2 > y4 and y2 > y6):
	print('YES')
	exit()

def check_line(c1, c2, c3, c4, c5, c6):
	if c1 < c5 and c2 > c4 and (c5 > c4):
		print('YES')
		exit()
	if c1 < c3 and c2 > c6 and (c6 < c3):
		print('YES')
		exit()

def check_corner(x, y, a, b, c, d):
	return x >= a and x <= c and (y >= b) and (y <= d)
check_line(x1, x2, x3, x4, x5, x6)
check_line(y1, y2, y3, y4, y5, y6)
if not (check_corner(x1, y1, x3, y3, x4, y4) or check_corner(x1, y1, x5, y5, x6, y6)):
	print('YES')
	exit()
if not (check_corner(x2, y1, x3, y3, x4, y4) or check_corner(x2, y1, x5, y5, x6, y6)):
	print('YES')
	exit()
if not (check_corner(x2, y2, x3, y3, x4, y4) or check_corner(x2, y2, x5, y5, x6, y6)):
	print('YES')
	exit()
if not (check_corner(x1, y2, x3, y3, x4, y4) or check_corner(x1, y2, x5, y5, x6, y6)):
	print('YES')
	exit()
print('NO')


def intersect(x1, y1, x2, y2, x3, y3, x4, y4):
	ax = max(x1, x3)
	bx = min(x2, x4)
	ay = max(y1, y3)
	by = min(y2, y4)
	if bx < ax or by < ay:
		return (0, 0, 0, 0)
	else:
		return (ax, ay, bx, by)

def square(x1, y1, x2, y2):
	return (x2 - x1) * (y2 - y1)
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
(px1, py1, px2, py2) = intersect(x1, y1, x2, y2, x3, y3, x4, y4)
(px3, py3, px4, py4) = intersect(x1, y1, x2, y2, x5, y5, x6, y6)
(ax, ay, bx, by) = intersect(px1, py1, px2, py2, px3, py3, px4, py4)
if square(x1, y1, x2, y2) > square(px1, py1, px2, py2) + square(px3, py3, px4, py4) - square(ax, ay, bx, by):
	print('YES')
else:
	print('NO')


i1 = input('').split(' ')
x1 = int(i1[0])
y1 = int(i1[1])
x2 = int(i1[2])
y2 = int(i1[3])
i1 = input('').split(' ')
x3 = int(i1[0])
y3 = int(i1[1])
x4 = int(i1[2])
y4 = int(i1[3])
i1 = input('').split(' ')
x5 = int(i1[0])
y5 = int(i1[1])
x6 = int(i1[2])
y6 = int(i1[3])

def chk(x1, y1, x2, y2, x3, y3):
	if x3 <= x2 and x3 >= x1 and (y3 >= y1) and (y3 <= y2):
		return True
	else:
		return False
r11 = chk(x3, y3, x4, y4, x1, y1)
r12 = chk(x5, y5, x6, y6, x1, y1)
r21 = chk(x3, y3, x4, y4, x2, y1)
r22 = chk(x5, y5, x6, y6, x2, y1)
r31 = chk(x3, y3, x4, y4, x1, y2)
r32 = chk(x5, y5, x6, y6, x1, y2)
r41 = chk(x3, y3, x4, y4, x2, y2)
r42 = chk(x5, y5, x6, y6, x2, y2)

def car(x1, y1, x2, y2, x3, y3, x4, y4):
	yy1 = max(y1, y3)
	yy2 = min(y2, y4)
	xx1 = max(x1, x3)
	xx2 = min(x2, x4)
	area = abs(yy1 - yy2) * abs(xx1 - xx2)
	return area
if (r11 or r12) and (r21 or r22) and (r31 or r32) and (r41 or r42):
	a1 = car(x1, y1, x2, y2, x3, y3, x4, y4)
	a2 = car(x1, y1, x2, y2, x5, y5, x6, y6)
	ta = a1 + a2
	if ta >= (x2 - x1) * (y2 - y1):
		print('NO')
	else:
		print('YES')
else:
	print('YES')


def S(A, B):
	if B[0] > A[0] or B[1] > A[1]:
		return False
	if B[2] < A[2] or B[3] < A[3]:
		return False
	return True

def V(A, B, C):
	if B[1] > A[1] or B[3] < A[3]:
		return False
	if C[1] > A[1] or C[3] < A[3]:
		return False
	if B[2] < C[0]:
		return False
	if B[0] > A[0] or C[2] < A[2]:
		return False
	return True

def H(A, B, C):
	if B[0] > A[0] or B[2] < A[2]:
		return False
	if C[0] > A[0] or C[2] < A[2]:
		return False
	if B[3] < C[1]:
		return False
	if B[1] > A[1] or C[3] < A[3]:
		return False
	return True
A = list(map(int, input().split(' ')))
B = list(map(int, input().split(' ')))
C = list(map(int, input().split(' ')))
if S(A, B) or S(A, C):
	print('NO')
	exit()
if B[0] > C[0]:
	(B, C) = (C, B)
if V(A, B, C):
	print('NO')
	exit()
if B[1] > C[1]:
	(B, C) = (C, B)
if H(A, B, C):
	print('NO')
	exit()
print('YES')


import sys

def over_lap(rect1, rect2):
	(x1, y1, x2, y2) = rect1
	(x3, y3, x4, y4) = rect2
	if x2 < x3 or x4 < x1 or y2 < y3 or (y4 < y1):
		return (0, 0, 0, 0)
	else:
		return (max(x1, x3), max(y1, y3), min(x2, x4), min(y2, y4))

def get_area(rect):
	(x1, y1, x2, y2) = rect
	return (x2 - x1) * (y2 - y1)

def is_all_cover(rect1, rect2, rect3):
	over1 = over_lap(rect1, rect2)
	over2 = over_lap(rect1, rect3)
	over3 = over_lap(over1, over2)
	area = get_area(over1) + get_area(over2) - get_area(over3)
	if area == get_area(rect1):
		return 'NO'
	else:
		return 'YES'
rect1 = [int(i) for i in sys.stdin.readline().strip().split(' ')]
rect2 = [int(i) for i in sys.stdin.readline().strip().split(' ')]
rect3 = [int(i) for i in sys.stdin.readline().strip().split(' ')]
print(is_all_cover(rect1, rect2, rect3))


R = lambda : [int(x + y) for (x, y) in zip('--++', input().split())]
x = lambda a, b: [*map(min, a, b)]
s = lambda x, y, u, v: max(0, x + u) * max(0, y + v)
(a, b, c) = (R(), R(), R())
d = x(a, b)
print('YNEOS'[s(*a) == s(*d) + s(*x(a, c)) - s(*x(d, c))::2])


import sys
import os

def cross(u, v):
	c = [0, 0, 0, 0]
	c[0] = max(u[0], v[0])
	c[1] = max(u[1], v[1])
	c[2] = min(u[2], v[2])
	c[3] = min(u[3], v[3])
	if c[0] >= c[2] or c[1] >= c[3]:
		return None
	return c

def area(u):
	if u is None:
		return 0
	return (u[2] - u[0]) * (u[3] - u[1])
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
c_ab = cross(a, b)
c_ac = cross(a, c)
cover = True
if c_ab is None and c_ac is None:
	cover = False
elif c_ab is None:
	cover = area(c_ac) == area(a)
elif c_ac is None:
	cover = area(c_ab) == area(a)
else:
	cc = cross(c_ab, c_ac)
	cover = area(c_ab) + area(c_ac) - area(cc) == area(a)
if cover:
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = list(map(int, input().split()))
(x3, y3, x4, y4) = list(map(int, input().split()))
(x5, y5, x6, y6) = list(map(int, input().split()))
px1 = max(0, min(x2, x4) - max(x1, x3))
py1 = max(0, min(y2, y4) - max(y1, y3))
px2 = max(0, min(x2, x6) - max(x1, x5))
py2 = max(0, min(y2, y6) - max(y1, y5))
px = max(0, min(x2, x4, x6) - max(x1, x3, x5))
py = max(0, min(y2, y4, y6) - max(y1, y3, y5))
if px1 * py1 + px2 * py2 - px * py == (x2 - x1) * (y2 - y1):
	print('NO')
else:
	print('YES')


from collections import deque
import sys

def inside(p, b):
	return b[0][0] <= p[0] <= b[0][1] and b[1][0] <= p[1] <= b[1][1]

def out(p, b1, b2):
	return not inside(p, b1) and (not inside(p, b2))

def inp():
	return sys.stdin.readline().strip()
(x1, y1, x2, y2) = map(int, inp().split())
(x3, y3, x4, y4) = map(int, inp().split())
(x5, y5, x6, y6) = map(int, inp().split())
f = False
w = [(x1, y1), (x2, y1), (x1, y2), (x2, y2)]
b1 = [sorted([x3, x4]), sorted([y3, y4])]
b2 = [sorted([x5, x6]), sorted([y5, y6])]
i = x1
while i <= x2:
	if out((i, y1), b1, b2) or out((i, y2), b1, b2):
		f = True
	i += 0.5
j = y1
while j <= y2:
	if out((x1, j), b1, b2) or out((x2, j), b1, b2):
		f = True
	j += 0.5
if f:
	print('YES')
else:
	print('NO')


import sys
line1Input = input()
line2Input = input()
line3Input = input()
word1Input = line1Input.split()
word2Input = line2Input.split()
word3Input = line3Input.split()
whiteX1 = int(word1Input[0])
whiteY1 = int(word1Input[1])
whiteX2 = int(word1Input[2])
whiteY2 = int(word1Input[3])
black1X1 = int(word2Input[0])
black1Y1 = int(word2Input[1])
black1X2 = int(word2Input[2])
black1Y2 = int(word2Input[3])
black2X1 = int(word3Input[0])
black2Y1 = int(word3Input[1])
black2X2 = int(word3Input[2])
black2Y2 = int(word3Input[3])
results = 'UNKNOWN'

def mySwap(a, b):
	return (b, a)
if black1X1 > black2X1:
	(black1X1, black2X1) = mySwap(black1X1, black2X1)
	(black1Y1, black2Y1) = mySwap(black1Y1, black2Y1)
	(black1X2, black2X2) = mySwap(black1X2, black2X2)
	(black1Y2, black2Y2) = mySwap(black1Y2, black2Y2)
if black1X1 <= whiteX1 and black1X2 >= whiteX2 and (black1Y1 <= whiteY1) and (black1Y2 >= whiteY2):
	results = 'NO'
elif black2X1 <= whiteX1 and black2X2 >= whiteX2 and (black2Y1 <= whiteY1) and (black2Y2 >= whiteY2):
	results = 'NO'
elif black1X1 <= whiteX1 and black1X2 >= whiteX2 and (black2X1 <= whiteX1) and (black2X2 >= whiteX2):
	if black1Y1 <= whiteY1 and black1Y2 >= black2Y1 and (black2Y2 >= whiteY2):
		results = 'NO'
	elif black2Y1 <= whiteY1 and black2Y2 >= black1Y1 and (black1Y2 >= whiteY2):
		results = 'NO'
	else:
		results = 'YES'
elif black1Y1 <= whiteY1 and black1Y2 >= whiteY2 and (black2Y1 <= whiteY1) and (black2Y2 >= whiteY2):
	if black1X1 <= whiteX1 and black1X2 >= black2X1 and (black2X2 >= whiteX2):
		results = 'NO'
	elif black2X1 <= whiteX1 and black2X2 >= black1X1 and (black1X2 >= whiteX2):
		results = 'NO'
	else:
		results = 'YES'
else:
	results = 'YES'
print(results)


def find(a, b):
	return (max(a[0], b[0]), max(a[1], b[1]), min(a[2], b[2]), min(a[3], b[3]))

def area(a):
	return max(a[2] - a[0], 0) * max(a[3] - a[1], 0)
w = [int(i) for i in input().split()]
b1 = [int(i) for i in input().split()]
b2 = [int(i) for i in input().split()]
if area(find(w, b1)) + area(find(w, b2)) - area(find(w, find(b1, b2))) == area(w):
	print('NO')
else:
	print('YES')


(wx1, wy1, wx2, wy2) = input().split()
(b1x1, b1y1, b1x2, b1y2) = input().split()
(b2x1, b2y1, b2x2, b2y2) = input().split()
cover = 0
(wx1, wy1, wx2, wy2) = (int(wx1), int(wy1), int(wx2), int(wy2))
(b1x1, b1y1, b1x2, b1y2) = (int(b1x1), int(b1y1), int(b1x2), int(b1y2))
(b2x1, b2y1, b2x2, b2y2) = (int(b2x1), int(b2y1), int(b2x2), int(b2y2))
if (b1x1 <= wx1 and b1x2 >= wx2) and (b1y1 <= wy1 and b1y2 >= wy2):
	print('NO')
elif (b2x1 <= wx1 and b2x2 >= wx2) and (b2y1 <= wy1 and b2y2 >= wy2):
	print('NO')
elif (b1x1 <= wx1 and b1x2 >= wx2) and (b2x1 <= wx1 and b2x2 >= wx2):
	min_y = min(b1y1, b2y1)
	if min_y == b1y1:
		if b1y2 - b2y1 >= 0:
			cover = 1
	elif b1y1 - b2y2 <= 0:
		cover = 1
	max_y = max(b1y2, b2y2)
	if min_y <= wy1 and max_y >= wy2 and (cover == 1):
		print('NO')
	else:
		print('YES')
elif (b1y1 <= wy1 and b1y2 >= wy2) and (b2y1 <= wy1 and b2y2 >= wy2):
	min_x = min(b1x1, b2x1)
	if min_x == b1x1:
		if b1x2 - b2x1 >= 0:
			cover = 1
	elif b1x1 - b2x2 <= 0:
		cover = 1
	max_x = max(b1x2, b2x2)
	if min_x <= wx1 and max_x >= wx2 and (cover == 1):
		print('NO')
	else:
		print('YES')
else:
	print('YES')


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
W = read_int_array()
B1 = read_int_array()
B2 = read_int_array()
by_x = [W[0], W[2], B1[0], B1[2], B2[0], B2[2]]
by_x.sort()
found = False
for x in by_x:
	if not W[0] <= x <= W[2]:
		continue
	interval = W[3] - W[1]
	for b in [B1, B2]:
		if b[0] <= x <= b[2]:
			interval -= max(0, min(b[3], W[3]) - max(b[1], W[1]))
	if interval > 0:
		found = True
		break
if not found:
	by_y = [W[1], W[3], B1[1], B1[3], B2[1], B2[3]]
	by_y.sort()
	for y in by_y:
		if not W[1] <= y <= W[3]:
			continue
		interval = W[2] - W[0]
		for b in [B1, B2]:
			if b[1] <= y <= b[3]:
				interval -= max(0, min(b[2], W[2]) - max(b[0], W[0]))
		if interval > 0:
			found = True
			break
print('YES' if found else 'NO')


def cut(A, B):
	return [(max([A[0][0], B[0][0]]), max([A[0][1], B[0][1]])), (min([A[1][0], B[1][0]]), min([A[1][1], B[1][1]]))]

def area(A):
	if A[1][0] < A[0][0] or A[1][1] < A[0][1]:
		return 0
	return max([(A[1][0] - A[0][0]) * (A[1][1] - A[0][1]), 0])

def common_area(A, B):
	return area(cut(A, B))
A = [int(x) for x in input().split()]
A = [[A[0], A[1]], [A[2], A[3]]]
B = [int(x) for x in input().split()]
B = [[B[0], B[1]], [B[2], B[3]]]
C = [int(x) for x in input().split()]
C = [[C[0], C[1]], [C[2], C[3]]]
print('YES' if area(A) - common_area(A, B) - common_area(A, C) + common_area(cut(A, B), cut(A, C)) > 0 else 'NO')


(x1, y1, x2, y2) = [int(x) for x in input().split()]
(x3, y3, x4, y4) = [int(x) for x in input().split()]
(x5, y5, x6, y6) = [int(x) for x in input().split()]
m = (y2 - y1) / (x2 - x1)
m2 = (y1 - y2) / (x2 - x1)
check = 0
for x in range(x1, x2 + 1):
	y = m * (x - x1) + y1
	if x >= x3 and x <= x4 and (y >= y3) and (y <= y4):
		check = 0
	elif x >= x5 and x <= x6 and (y >= y5) and (y <= y6):
		check = 0
	else:
		check = 1
		break
	y = m2 * (x - x1) + y2
	if x >= x3 and x <= x4 and (y >= y3) and (y <= y4):
		check = 0
	elif x >= x5 and x <= x6 and (y >= y5) and (y <= y6):
		check = 0
	else:
		check = 1
		break
	t = x + 0.5
	if t > x2:
		break
	y = m * (t - x1) + y1
	if t >= x3 and t <= x4 and (y >= y3) and (y <= y4):
		check = 0
	elif t >= x5 and t <= x6 and (y >= y5) and (y <= y6):
		check = 0
	else:
		check = 1
		break
	t = x + 0.5
	if t > x2:
		break
	y = m2 * (t - x1) + y2
	if t >= x3 and t <= x4 and (y >= y3) and (y <= y4):
		check = 0
	elif t >= x5 and t <= x6 and (y >= y5) and (y <= y6):
		check = 0
	else:
		check = 1
		break
if check == 1:
	print('YES')
else:
	for y in range(y1, y2 + 1):
		x = (y - y1 + m * x1) / m
		if x >= x3 and x <= x4 and (y >= y3) and (y <= y4):
			check = 0
		elif x >= x5 and x <= x6 and (y >= y5) and (y <= y6):
			check = 0
		else:
			check = 1
			break
		x = (y - y2 + m2 * x1) / m2
		if x >= x3 and x <= x4 and (y >= y3) and (y <= y4):
			check = 0
		elif x >= x5 and x <= x6 and (y >= y5) and (y <= y6):
			check = 0
		else:
			check = 1
			break
		t = y + 0.5
		if t > y2:
			break
		x = (t - y1 + m * x1) / m
		if x >= x3 and x <= x4 and (t >= y3) and (t <= y4):
			check = 0
		elif x >= x5 and x <= x6 and (t >= y5) and (t <= y6):
			check = 0
		else:
			check = 1
			break
		t = y + 0.5
		if t > y2:
			break
		x = (t - y2 + m2 * x1) / m2
		if x >= x3 and x <= x4 and (t >= y3) and (t <= y4):
			check = 0
		elif x >= x5 and x <= x6 and (t >= y5) and (t <= y6):
			check = 0
		else:
			check = 1
			break
	if check == 0:
		print('NO')
	else:
		print('YES')


whitepaper = input()
blackpaper = input()
orangepaper = input()
white = []
for i in whitepaper.split(' '):
	white.append(int(i))
orange = []
for i in orangepaper.split(' '):
	orange.append(int(i))
black = []
for i in blackpaper.split(' '):
	black.append(int(i))
whitearea = (white[2] - white[0]) * (white[3] - white[1])
orangecoverx = max(min(orange[2], white[2]) - max(orange[0], white[0]), 0)
orangecovery = max(min(orange[3], white[3]) - max(orange[1], white[1]), 0)
orangecover = orangecoverx * orangecovery
blackcoverx = max(min(black[2], white[2]) - max(black[0], white[0]), 0)
blackcovery = max(min(black[3], white[3]) - max(black[1], white[1]), 0)
blackcover = blackcoverx * blackcovery
doublecover = blackcover + orangecover
triplecoverx = max(min(black[2], white[2], orange[2]) - max(black[0], white[0], orange[0]), 0)
triplecovery = max(min(black[3], white[3], orange[3]) - max(black[1], white[1], orange[1]), 0)
cover = doublecover - triplecoverx * triplecovery
whitearea -= cover
if whitearea >= 1:
	print('YES')
else:
	print('NO')


import sys
import math
input = sys.stdin.readline
w = list(map(int, input().split()))
b1 = list(map(int, input().split()))
b2 = list(map(int, input().split()))
x1 = max(w[0], b1[0])
x2 = min(w[2], b1[2])
y1 = max(w[1], b1[1])
y2 = min(w[3], b1[3])
x3 = max(w[0], b2[0])
x4 = min(w[2], b2[2])
y3 = max(w[1], b2[1])
y4 = min(w[3], b2[3])
xa = max(x1, x3)
xb = min(x2, x4)
ya = max(y1, y3)
yb = min(y2, y4)
ans = (w[3] - w[1]) * (w[2] - w[0])
if x2 >= x1 and y2 >= y1:
	ans -= (x2 - x1) * (y2 - y1)
if xb >= xa and yb >= ya:
	ans += (xb - xa) * (yb - ya)
if x4 >= x3 and y4 >= y3:
	ans -= (x4 - x3) * (y4 - y3)
if ans > 0:
	print('YES')
else:
	print('NO')


white = input().split()
black1 = input().split()
black2 = input().split()
(x1, y1, x2, y2) = list(map(int, white))
(x3, y3, x4, y4) = list(map(int, black1))
(x5, y5, x6, y6) = list(map(int, black2))
blockX = False
largest = max(x4, x6)
smallest = min(x3, x5)
mid1 = min(x4, x6)
mid2 = max(x3, x5)
largeY = min(y4, y6)
smallY = max(y3, y5)
if largest >= x2 and smallest <= x1 and (mid1 - mid2 >= 0) and (largeY >= y2) and (smallY <= y1):
	blockX = True
blockY = False
largest = max(y4, y6)
smallest = min(y3, y5)
mid1 = min(y4, y6)
mid2 = max(y3, y5)
largeY = min(x4, x6)
smallY = max(x3, x5)
if largest >= y2 and smallest <= y1 and (mid1 - mid2 >= 0) and (largeY >= x2) and (smallY <= x1):
	blockY = True
complete = False
if x6 >= x2 and x5 <= x1 and (y6 >= y2) and (y5 <= y1):
	complete = True
elif x4 >= x2 and x3 <= x1 and (y4 >= y2) and (y3 <= y1):
	complete = True
covered = False
if blockX or blockY or complete:
	covered = True
if not covered:
	print('YES')
else:
	print('NO')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())

def within(x, y, xl, yl, xr, yr):
	return xl <= x <= xr and yl <= y <= yr
corners = [set(), set()]
for (j, (x, y)) in enumerate(((x1, y1), (x1, y2), (x2, y1), (x2, y2))):
	for (i, (xl, yl, xr, yr)) in enumerate(((x3, y3, x4, y4), (x5, y5, x6, y6))):
		if within(x, y, xl, yl, xr, yr):
			corners[i].add(j)
if corners[0] == {0, 1, 2, 3} or corners[1] == {0, 1, 2, 3}:
	print('NO')
elif corners[0] | corners[1] != {0, 1, 2, 3}:
	print('YES')
else:
	for (i, (xl, yl, xr, yr)) in enumerate(((x3, y3, x4, y4), (x5, y5, x6, y6))):
		if xl <= x1 <= x2 <= xr and yl <= y1 <= yr:
			y1 = yr
		if xl <= x1 <= x2 <= xr and yl <= y2 <= yr:
			y2 = yl
		if yl <= y1 <= y2 <= yr and xl <= x1 <= xr:
			x1 = xr
		if yl <= y1 <= y2 <= yr and xl <= x2 <= xr:
			x2 = xl
	if x1 < x2 and y1 < y2:
		print('YES')
	else:
		print('NO')


white_rect = list(map(int, input().split()))
black_rect_1 = list(map(int, input().split()))
black_rect_2 = list(map(int, input().split()))
overlapped = False
if black_rect_1[0] <= white_rect[0] and black_rect_1[1] <= white_rect[1] and (black_rect_1[2] >= white_rect[2]) and (black_rect_1[3] >= white_rect[3]):
	overlapped = True
if black_rect_2[0] <= white_rect[0] and black_rect_2[1] <= white_rect[1] and (black_rect_2[2] >= white_rect[2]) and (black_rect_2[3] >= white_rect[3]):
	overlapped = True
if black_rect_1[0] <= white_rect[0] and black_rect_1[2] >= white_rect[2] and (black_rect_1[1] <= white_rect[1]) and (black_rect_2[0] <= white_rect[0]) and (black_rect_2[2] >= white_rect[2]) and (black_rect_2[3] >= white_rect[3]) and (black_rect_1[3] >= black_rect_2[1]):
	overlapped = True
if black_rect_2[0] <= white_rect[0] and black_rect_2[2] >= white_rect[2] and (black_rect_2[1] <= white_rect[1]) and (black_rect_1[0] <= white_rect[0]) and (black_rect_1[2] >= white_rect[2]) and (black_rect_1[3] >= white_rect[3]) and (black_rect_2[3] >= black_rect_1[1]):
	overlapped = True
if black_rect_1[1] <= white_rect[1] and black_rect_1[3] >= white_rect[3] and (black_rect_1[0] <= white_rect[0]) and (black_rect_2[1] <= white_rect[1]) and (black_rect_2[3] >= white_rect[3]) and (black_rect_2[2] >= white_rect[2]) and (black_rect_1[2] >= black_rect_2[0]):
	overlapped = True
if black_rect_2[1] <= white_rect[1] and black_rect_2[3] >= white_rect[3] and (black_rect_2[0] <= white_rect[0]) and (black_rect_1[1] <= white_rect[1]) and (black_rect_1[3] >= white_rect[3]) and (black_rect_1[2] >= white_rect[2]) and (black_rect_2[2] >= black_rect_1[0]):
	overlapped = True
if overlapped:
	print('NO')
else:
	print('YES')


ii = lambda : int(input())
kk = lambda : map(int, input().split())
ll = lambda : list(kk())

def area(r):
	return (r[2] - r[0]) * (r[3] - r[1])

def intersect(r1, r2):
	t = (max(r1[0], r2[0]), max(r1[1], r2[1]), min(r1[2], r2[2]), min(r1[3], r2[3]))
	if t[0] < t[2] and t[1] < t[3]:
		return t
	return (0, 0, 0, 0)
(r1, r2, r3) = [tuple(kk()) for _ in range(3)]
r12 = intersect(r1, r2)
r13 = intersect(r1, r3)
r123 = intersect(r12, r13)
print('YNEOS'[area(r1) - area(r12) - area(r13) + area(r123) <= 0::2])


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())

def cmp_x(x1, x2, x):
	if x < x1:
		x = x1
	if x > x2:
		x = x2
	return x

def cmp_y(y1, y2, y):
	if y < y1:
		y = y1
	if y > y2:
		y = y2
	return y
x3 = cmp_x(x1, x2, x3)
x4 = cmp_x(x1, x2, x4)
x5 = cmp_x(x1, x2, x5)
x6 = cmp_x(x1, x2, x6)
y3 = cmp_y(y1, y2, y3)
y4 = cmp_y(y1, y2, y4)
y5 = cmp_y(y1, y2, y5)
y6 = cmp_y(y1, y2, y6)
sub_area = (y4 - y3) * (x4 - x3) + (y6 - y5) * (x6 - x5)
area = (x2 - x1) * (y2 - y1)
x3 = cmp_x(x5, x6, x3)
x4 = cmp_x(x5, x6, x4)
y3 = cmp_y(y5, y6, y3)
y4 = cmp_y(y5, y6, y4)
sub_area -= (y4 - y3) * (x4 - x3)
if sub_area < area:
	print('YES')
else:
	print('NO')


from sys import stdin, stdout, setrecursionlimit
input = stdin.readline
from collections import defaultdict as dd
from collections import Counter, deque
from heapq import *
import math
from math import floor, ceil, sqrt

def geti():
	return map(int, input().strip().split())

def getl():
	return list(map(int, input().strip().split()))

def getis():
	return map(str, input().strip().split())

def getls():
	return list(map(str, input().strip().split()))

def gets():
	return input().strip()

def geta():
	return int(input())

def print_s(s):
	stdout.write(s + '\n')

class rect:

	def __init__(self, x1, y1, x2, y2):
		self.x1 = x1
		self.x2 = x2
		self.y1 = y1
		self.y2 = y2

	def covered(self, x1, y1):
		return self.x1 <= x1 <= self.x2 and self.y1 <= y1 <= self.y2

	def points(self):
		return [(self.x1, self.y1), (self.x2, self.y1), (self.x1, self.y2), (self.x2, self.y2)]

def solve():
	w = rect(*getl())
	b1 = rect(*getl())
	b2 = rect(*getl())
	corners = 0
	for (px, py) in w.points():
		if b1.covered(px, py) or b2.covered(px, py):
			corners += 1
	if corners != 4:
		print('YES')
	elif b1.covered(w.x1, w.y1) and b1.covered(w.x2, w.y1) or (b2.covered(w.x1, w.y1) and b2.covered(w.x2, w.y1)):
		y = w.y2 - w.y1
		y -= max(min(w.y2, b1.y2) - max(w.y1, b1.y1), 0)
		y -= max(min(w.y2, b2.y2) - max(w.y1, b2.y1), 0)
		if y > 0:
			print('YES')
		else:
			print('NO')
	elif b1.covered(w.x1, w.y1) and b1.covered(w.x1, w.y2) or (b2.covered(w.x1, w.y1) and b2.covered(w.x1, w.y2)):
		x = w.x2 - w.x1
		x -= max(min(w.x2, b1.x2) - max(w.x1, b1.x1), 0)
		x -= max(min(w.x2, b2.x2) - max(w.x1, b2.x1), 0)
		if x > 0:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
solve()


R = lambda : [*map(int, input().split())]
(x, y, u, v) = R()
a = (b, c) = (R(), R())
(e, f, g, h) = sorted(b[::2] + c[::2])
(i, j, k, l) = sorted(b[1::2] + c[1::2])
if f in (b[0], c[0]) and j in (b[1], c[1]):
	a += ((e, j, h, k), (f, i, g, l))
print('YNEOS'[any(((e <= x <= u <= g) & (f <= y <= v <= h) for (e, f, g, h) in a))::2])


r1 = list(map(int, input().split()))
r2 = list(map(int, input().split()))
r3 = list(map(int, input().split()))

def intersection(a, b):
	return (max(a[0], b[0]), max(a[1], b[1]), min(a[2], b[2]), min(a[3], b[3]))

def area(a):
	return max(a[2] - a[0], 0) * max(a[3] - a[1], 0)
if area(intersection(r1, r2)) + area(intersection(r1, r3)) - area(intersection(r1, intersection(r2, r3))) == area(r1):
	print('NO')
else:
	print('YES')


class Rect:

	def __init__(self, x1, y1, x2, y2):
		self.x1 = x1
		self.y1 = y1
		self.x2 = x2
		self.y2 = y2

	def intersect(self, other):
		_x1 = max(self.x1, other.x1)
		_x2 = min(self.x2, other.x2)
		if _x1 >= _x2:
			return Rect(0, 0, 0, 0)
		_y1 = max(self.y1, other.y1)
		_y2 = min(self.y2, other.y2)
		if _y1 >= _y2:
			return Rect(0, 0, 0, 0)
		return Rect(_x1, _y1, _x2, _y2)

	def area(self) -> int:
		return (self.x2 - self.x1) * (self.y2 - self.y1)
rect1 = Rect(*map(int, input().split()))
rect2 = Rect(*map(int, input().split()))
rect3 = Rect(*map(int, input().split()))
covered_area = rect1.intersect(rect2).area() + rect1.intersect(rect3).area() - rect1.intersect(rect2.intersect(rect3)).area()
if rect1.area() <= covered_area:
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split(' '))
(x3, y3, x4, y4) = map(int, input().split(' '))
(x5, y5, x6, y6) = map(int, input().split(' '))

def sp(x1, x2, x3, x4, y1, y2, y3, y4):
	if x2 > x4:
		f_px = x4
	else:
		f_px = x2
	if x1 > x3:
		s_px = x1
	else:
		s_px = x3
	if y4 > y2:
		f_py = y2
	else:
		f_py = y4
	if y1 > y3:
		s_py = y1
	else:
		s_py = y3
	l = f_px - s_px
	if l < 0:
		l = 0
	h = f_py - s_py
	if h < 0:
		h = 0
	return (f_px, s_px, f_py, s_py, l * h)
s_w = (x2 - x1) * (y2 - y1)
(f1, s1, f2, s2, s_b1) = sp(x1, x2, x3, x4, y1, y2, y3, y4)
(f3, s3, f4, s4, s_b2) = sp(x1, x2, x5, x6, y1, y2, y5, y6)
(aa, aaa, aaaa, aaaaa, s_b3) = sp(s1, f1, s3, f3, s2, f2, s4, f4)
if s_w > s_b2 + s_b1 - s_b3:
	print('YES')
else:
	print('NO')


_1 = tuple(map(int, input().split()))
_2 = tuple(map(int, input().split()))
_3 = tuple(map(int, input().split()))

def in_rect(x, a):
	if a[0] <= x[0] <= a[2] and a[1] <= x[1] <= a[3]:
		return True
	return False

def inter(w, b):
	kib = kab = kia = kaa = False
	temp = 0
	if in_rect((w[0], w[1]), b):
		temp += 1
		kib = True
	if in_rect((w[0], w[3]), b):
		temp += 1
		kia = True
	if in_rect((w[2], w[1]), b):
		temp += 1
		kab = True
	if in_rect((w[2], w[3]), b):
		temp += 1
		kaa = True
	return (temp, kib, kia, kab, kaa)
inter1 = inter(_1, _2)
inter2 = inter(_1, _3)
s = inter1[0] + inter2[0]
for i in range(1, 5):
	if inter1[i] == inter2[i] == True:
		s -= 1
if s < 4:
	print('YES')
	exit(0)
if inter1[0] >= 3 or inter2[0] >= 3:
	print('NO')
	exit(0)
if inter1[1] == inter1[2] == inter2[3] == inter2[4] == True:
	if _2[2] >= _3[0]:
		print('NO')
	else:
		print('YES')
elif inter1[1] == inter2[2] == inter1[3] == inter2[4] == True:
	if _2[3] >= _3[1]:
		print('NO')
	else:
		print('YES')
elif inter2[1] == inter2[2] == inter1[3] == inter1[4] == True:
	if _3[2] >= _2[0]:
		print('NO')
	else:
		print('YES')
elif inter2[1] == inter1[2] == inter2[3] == inter1[4] == True:
	if _3[3] >= _2[1]:
		print('NO')
	else:
		print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())

def is_inside(x, y, xl, yl, xr, yr):
	return xl <= x and x <= xr and (yl <= y) and (y <= yr)
if is_inside(x1, y1, x3, y3, x4, y4) and is_inside(x1, y2, x3, y3, x4, y4) and is_inside(x2, y1, x3, y3, x4, y4) and is_inside(x2, y2, x3, y3, x4, y4):
	print('NO')
	exit()
if is_inside(x1, y1, x5, y5, x6, y6) and is_inside(x1, y2, x5, y5, x6, y6) and is_inside(x2, y1, x5, y5, x6, y6) and is_inside(x2, y2, x5, y5, x6, y6):
	print('NO')
	exit()
if (is_inside(x1, y1, x3, y3, x4, y4) or is_inside(x1, y1, x5, y5, x6, y6)) and (is_inside(x1, y2, x3, y3, x4, y4) or is_inside(x1, y2, x5, y5, x6, y6)) and (is_inside(x2, y1, x3, y3, x4, y4) or is_inside(x2, y1, x5, y5, x6, y6)) and (is_inside(x2, y2, x3, y3, x4, y4) or is_inside(x2, y2, x5, y5, x6, y6)):
	if is_inside(x3, y3, x5, y5, x6, y6) or is_inside(x3, y4, x5, y5, x6, y6) or is_inside(x4, y3, x5, y5, x6, y6) or is_inside(x4, y4, x5, y5, x6, y6):
		print('NO')
		exit()
	if is_inside(x5, y5, x3, y3, x4, y4) or is_inside(x5, y6, x3, y3, x4, y4) or is_inside(x6, y5, x3, y3, x4, y4) or is_inside(x6, y6, x3, y3, x4, y4):
		print('NO')
		exit()
print('YES')


rec1 = list(map(int, input().split()))
rec2 = list(map(int, input().split()))
rec3 = list(map(int, input().split()))

def square(rect):
	if rect[2] - rect[0] <= 0 or rect[3] - rect[1] <= 0:
		return 0
	return (rect[2] - rect[0]) * (rect[3] - rect[1])

def cover(rect1, rect2):
	return [max(rect1[0], rect2[0]), max(rect1[1], rect2[1]), min(rect1[2], rect2[2]), min(rect1[3], rect2[3])]
cov1 = cover(rec1, rec2)
cov2 = cover(rec1, rec3)
cov3 = cover(cov1, cov2)
if square(rec1) == square(cov1) + square(cov2) - square(cov3):
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
W = (y2 - y1) * (x2 - x1)

def rect(wx1, wy1, wx2, wy2, bx1, by1, bx2, by2):
	if bx2 <= wx1 or wx2 <= bx1 or by2 <= wy1 or (wy2 <= by1):
		return [0, 0, 0, 0]
	else:
		return [max(wx1, bx1), max(wy1, by1), min(wx2, bx2), min(wy2, by2)]
S1 = rect(x1, y1, x2, y2, x3, y3, x4, y4)
B1 = (S1[2] - S1[0]) * (S1[3] - S1[1])
S2 = rect(x1, y1, x2, y2, x5, y5, x6, y6)
B2 = (S2[2] - S2[0]) * (S2[3] - S2[1])
S3 = rect(x3, y3, x4, y4, x5, y5, x6, y6)
S3 = rect(S3[0], S3[1], S3[2], S3[3], x1, y1, x2, y2)
M = (S3[2] - S3[0]) * (S3[3] - S3[1])
print('YES' if W - B1 - B2 + M != 0 else 'NO')


from sys import stdin, stdout
(x1, y1, x2, y2) = list(map(int, input().split()))
(x3, y3, x4, y4) = list(map(int, input().split()))
(x5, y5, x6, y6) = list(map(int, input().split()))
S1 = 0
S2 = 0
S = 0
l1 = min(x2, x4) - max(x1, x3)
h1 = min(y2, y4) - max(y1, y3)
if l1 >= 0 and h1 >= 0:
	S1 = l1 * h1
l2 = min(x2, x6) - max(x1, x5)
h2 = min(y2, y6) - max(y1, y5)
if l2 >= 0 and h2 >= 0:
	S2 = l2 * h2
l3 = min(x2, x6, x4) - max(x1, x5, x3)
h3 = min(y2, y6, y4) - max(y1, y5, y3)
if l3 >= 0 and h3 >= 0:
	S = l3 * h3
if S1 + S2 - S == (x2 - x1) * (y2 - y1):
	print('NO')
else:
	print('YES')


class Point:

	def __init__(self):
		self.x = 0
		self.y = 0

	def __repr__(self):
		return f'({self.x}, {self.y})'

def covers(p1, p2, p3, p4):
	if p3.x <= p1.x and p2.x <= p4.x and (p3.y <= p1.y) and (p2.y <= p4.y):
		return True
	return False

def splits(p1, p2, p3, p4):
	if p1.x <= p3.x < p2.x <= p4.x or p3.x <= p1.x < p4.x <= p2.x:
		if p3.y <= p1.y and p2.y <= p4.y:
			if p3.x <= p1.x:
				p1.x = p4.x
			else:
				p2.x = p3.x
			return True
	if p1.y <= p3.y < p2.y <= p4.y or p3.y <= p1.y < p4.y <= p2.y:
		if p3.x <= p1.x and p2.x <= p4.x:
			if p3.y <= p1.y:
				p1.y = p4.y
			else:
				p2.y = p3.y
			return True
	return False
(p1, p2, p3, p4, p5, p6) = [Point() for _ in range(6)]
(p1.x, p1.y, p2.x, p2.y) = map(int, input().split(' '))
(p3.x, p3.y, p4.x, p4.y) = map(int, input().split(' '))
(p5.x, p5.y, p6.x, p6.y) = map(int, input().split(' '))
if covers(p1, p2, p3, p4) or covers(p1, p2, p5, p6):
	print('NO')
elif splits(p1, p2, p3, p4):
	if covers(p1, p2, p5, p6):
		print('NO')
	else:
		print('YES')
else:
	print('YES')


def intersec(c1, c2):
	x = max(0, min(c1[2], c2[2]) - max(c1[0], c2[0]))
	y = max(0, min(c1[3], c2[3]) - max(c1[1], c2[1]))
	if x * y == 0:
		return [0] * 4
	else:
		ans = [0] * 4
		ans[0] = max(c1[0], c2[0])
		ans[1] = max(c1[1], c2[1])
		ans[2] = min(c1[2], c2[2])
		ans[3] = min(c1[3], c2[3])
		return ans

def area(c):
	return (c[2] - c[0]) * (c[3] - c[1])

def solve():
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = list(map(int, input().split()))
	inter_b = intersec(a, b)
	inter_c = intersec(a, c)
	inter = intersec(inter_b, inter_c)
	if area(a) - area(inter_b) - area(inter_c) + area(inter) <= 0:
		print('NO')
	else:
		print('YES')
solve()


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if x3 >= x2 or x4 <= x1 or y3 >= y2 or (y4 <= y1):
	if x5 <= x1 and x6 >= x2 and (y5 <= y1) and (y6 >= y2):
		print('NO')
	else:
		print('YES')
elif x5 >= x2 or x6 <= x1 or y5 >= y2 or (y6 <= y1):
	if x3 <= x1 and x4 >= x2 and (y3 <= y1) and (y4 >= y2):
		print('NO')
	else:
		print('YES')
else:
	horizontal = False
	vertical = False
	if x3 < x5 and x5 > x1:
		leftend = x3
		leftmiddle = x4
		rightmiddle = x5
		rightend = x6
		lefty = y3
		lmy = y4
		rmy = y5
		righty = y6
	elif x5 < x3 and x3 > x1:
		leftend = x5
		leftmiddle = x6
		rightmiddle = x3
		rightend = x4
		lefty = y5
		lmy = y6
		rmy = y3
		righty = y4
	elif y3 <= y5:
		leftend = x3
		leftmiddle = x4
		rightmiddle = x5
		rightend = x6
		lefty = y3
		lmy = y4
		rmy = y5
		righty = y6
	else:
		leftend = x5
		leftmiddle = x6
		rightmiddle = x3
		rightend = x4
		lefty = y5
		lmy = y6
		rmy = y3
		righty = y4
	if x1 < leftmiddle < x2 or x1 < rightmiddle < x2:
		horizontal = True
	if y1 < lmy < y2 or y1 < rmy < y2:
		vertical = True
	if x3 <= x1 and x4 >= x2 and (y3 <= y1) and (y4 >= y2):
		print('NO')
	elif x5 <= x1 and x6 >= x2 and (y5 <= y1) and (y6 >= y2):
		print('NO')
	elif leftend <= x1 and rightend >= x2 and (lefty <= y1) and (righty >= y2):
		if horizontal and vertical:
			print('YES')
		elif horizontal and leftmiddle >= rightmiddle:
			print('NO')
		elif vertical and lmy >= rmy:
			print('NO')
		else:
			print('YES')
	else:
		print('YES')


def findCommon(coords1, coords2):
	xrange1 = (coords1[0], coords1[2])
	xrange2 = (coords2[0], coords2[2])
	ranges = [xrange1, xrange2]
	ranges.sort()
	if ranges[1][0] >= ranges[0][1]:
		xcommon = 0
	else:
		xcommon = min(ranges[0][1], ranges[1][1]) - ranges[1][0]
	yrange1 = (coords1[1], coords1[3])
	yrange2 = (coords2[1], coords2[3])
	ranges = [yrange1, yrange2]
	ranges.sort()
	if ranges[1][0] >= ranges[0][1]:
		ycommon = 0
	else:
		ycommon = min(ranges[0][1], ranges[1][1]) - ranges[1][0]
	return xcommon * ycommon

def findCommon2(coords1, coords2, coords3):
	xrange1 = (coords1[0], coords1[2])
	xrange2 = (coords2[0], coords2[2])
	ranges = [xrange1, xrange2]
	ranges.sort()
	if ranges[1][0] >= ranges[0][1]:
		return 0
	else:
		x1 = ranges[1][0]
		x2 = min(ranges[0][1], ranges[1][1])
	yrange1 = (coords1[1], coords1[3])
	yrange2 = (coords2[1], coords2[3])
	ranges = [yrange1, yrange2]
	ranges.sort()
	if ranges[1][0] >= ranges[0][1]:
		return 0
	else:
		y1 = ranges[1][0]
		y2 = min(ranges[0][1], ranges[1][1])
	return findCommon((x1, y1, x2, y2), coords3)

def main():
	(x1, y1, x2, y2) = map(int, input().split())
	(x3, y3, x4, y4) = map(int, input().split())
	(x5, y5, x6, y6) = map(int, input().split())
	area = (x2 - x1) * (y2 - y1)
	common = findCommon((x1, y1, x2, y2), (x3, y3, x4, y4))
	area -= common
	common = findCommon((x1, y1, x2, y2), (x5, y5, x6, y6))
	area -= common
	area += findCommon2((x3, y3, x4, y4), (x5, y5, x6, y6), (x1, y1, x2, y2))
	if area > 0:
		print('YES')
	else:
		print('NO')
main()


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if x3 <= x1 and x2 <= x4 and (y3 <= y1) and (y2 <= y4) or (x5 <= x1 and x2 <= x6 and (y5 <= y1) and (y2 <= y6)):
	print('NO')
	exit(0)
if x3 <= x1 and x2 <= x4 and (x5 <= x1) and (x2 <= x6):
	if y3 <= y5 <= y4 or y3 <= y6 <= y4:
		ya = min(y3, y5)
		yb = max(y4, y6)
		if ya <= y1 and y2 <= yb:
			print('NO')
			exit(0)
if y3 <= y1 and y2 <= y4 and (y5 <= y1) and (y2 <= y6):
	if x3 <= x5 <= x4 or x3 <= x6 <= x4:
		xa = min(x3, x5)
		xb = max(x4, x6)
		if xa <= x1 and x2 <= xb:
			print('NO')
			exit(0)
print('YES')


w_sheet = list(map(int, input().split()))
b_sheet1 = list(map(int, input().split()))
b_sheet2 = list(map(int, input().split()))
w_sheet = [element * 2 for element in w_sheet]
b_sheet1 = [element * 2 for element in b_sheet1]
b_sheet2 = [element * 2 for element in b_sheet2]

def intersect(sheet1, sheet2):
	x_left = max(sheet1[0], sheet2[0])
	y_bottom = max(sheet1[1], sheet2[1])
	x_right = min(sheet1[2], sheet2[2])
	y_top = min(sheet1[3], sheet2[3])
	if x_right <= x_left or y_top <= y_bottom:
		return [0, 0, 0, 0]
	return [x_left, y_bottom, x_right, y_top]

def square(sheet):
	return abs(sheet[0] - sheet[2]) * abs(sheet[1] - sheet[3])
wb1_sheet = intersect(w_sheet, b_sheet1)
wb2_sheet = intersect(w_sheet, b_sheet2)
inter_sheet = intersect(wb1_sheet, wb2_sheet)
white_sq = square(w_sheet)
wb1_sq = square(wb1_sheet)
wb2_sq = square(wb2_sheet)
inter_sq = square(inter_sheet)
if white_sq > wb1_sq + wb2_sq - inter_sq:
	print('YES')
else:
	print('NO')


a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
if (b[0] <= a[0] and b[1] <= a[1]) and (b[2] >= a[2] and b[3] >= a[3]):
	print('NO')
elif (c[0] <= a[0] and c[1] <= a[1]) and (c[2] >= a[2] and c[3] >= a[3]):
	print('NO')
elif b[0] <= a[0] and b[1] <= a[1]:
	if b[2] >= a[2] and b[3] >= a[3]:
		print('NO')
	elif b[2] >= a[2]:
		x = a[0]
		y = b[3]
		if c[0] <= x and c[1] <= y:
			if c[2] >= a[2] and c[3] >= a[3]:
				print('NO')
			else:
				print('YES')
		else:
			print('YES')
	elif b[3] >= a[3]:
		x = b[2]
		y = a[1]
		if c[0] <= x and c[1] <= y:
			if c[2] >= a[2] and c[3] >= a[3]:
				print('NO')
			else:
				print('YES')
		else:
			print('YES')
	else:
		print('YES')
elif c[0] <= a[0] and c[1] <= a[1]:
	if c[2] >= a[2] and c[3] >= a[3]:
		print('NO')
	elif c[2] >= a[2]:
		x = a[0]
		y = c[3]
		if b[0] <= x and b[1] <= y:
			if b[2] >= a[2] and b[3] >= a[3]:
				print('NO')
			else:
				print('YES')
		else:
			print('YES')
	elif c[3] >= a[3]:
		x = c[2]
		y = a[1]
		if b[0] <= x and b[1] <= y:
			if b[2] >= a[2] and b[3] >= a[3]:
				print('NO')
			else:
				print('YES')
		else:
			print('YES')
	else:
		print('YES')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
az1 = x1 >= x3 and x1 <= x4 and (y1 >= y3) and (y1 <= y4)
az2 = x2 >= x3 and x2 <= x4 and (y1 >= y3) and (y1 <= y4)
az3 = x2 >= x3 and x2 <= x4 and (y2 >= y3) and (y2 <= y4)
az4 = x1 >= x3 and x1 <= x4 and (y2 >= y3) and (y2 <= y4)
bz1 = x1 >= x5 and x1 <= x6 and (y1 >= y5) and (y1 <= y6)
bz2 = x2 >= x5 and x2 <= x6 and (y1 >= y5) and (y1 <= y6)
bz3 = x2 >= x5 and x2 <= x6 and (y2 >= y5) and (y2 <= y6)
bz4 = x1 >= x5 and x1 <= x6 and (y2 >= y5) and (y2 <= y6)
z5 = not (x3 > x6 or x5 > x4 or y4 < y5 or (y6 < y3))
z6 = x1 >= x3 and y1 >= y3 and (x2 <= x4) and (y2 <= y4)
z7 = x1 >= x5 and y1 >= y5 and (x2 <= x6) and (y2 <= y6)
t1 = all([az1, az2, az3, az4, z6])
t2 = all([bz1, bz2, bz3, bz4, z7])
t3 = all([az1 or bz1, az2 or bz2, az3 or bz3, az4 or bz4, z5])
print(['YES', 'NO'][t1 or t2 or t3])


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())

def checkHeight():
	if x3 > x1 and x4 < x2:
		if x5 <= x1 and x6 >= x2:
			return True
		else:
			return False
	elif x3 > x1 and x3 < x2 and (x4 >= x2) or (x4 < x2 and x4 > x1 and (x3 <= x1)):
		if x3 > x1:
			if x5 <= x1 and x6 >= x3:
				return True
			else:
				return False
		elif x5 <= x4 and x6 >= x2:
			return True
		else:
			return False
	elif x3 <= x1 and x4 >= x2:
		return True
	elif x5 <= x1 and x6 >= x2:
		return True
	else:
		return False

def checkHeight2():
	if y3 > y1 and y4 < y2:
		if y5 <= y1 and y6 >= y2:
			return True
		else:
			return False
	elif y3 > y1 and y3 < y2 and (y4 >= y2) or (y4 < y2 and y4 > y1 and (y3 <= y1)):
		if y3 > y1:
			if y5 <= y1 and y6 >= y3:
				return True
			else:
				return False
		elif y5 <= y4 and y6 >= y2:
			return True
		else:
			return False
	elif y3 <= y1 and y4 >= y2:
		return True
	elif y5 <= y1 and y6 >= y2:
		return True
	else:
		return False

def checkSide():
	if x3 <= x1 and x4 >= x2:
		if y3 <= y1 and y4 >= y2:
			return True
		else:
			return False
	elif x5 <= x1 and x6 >= x2:
		if y5 <= y1 and y6 >= y2:
			return True
		else:
			return False
	elif (y3 <= y1 and y4 >= y2) and (y5 <= y1 and y6 >= y2):
		return True
	else:
		return False

def checkSide2():
	if y3 <= y1 and y4 >= y2:
		if x3 <= x1 and x4 >= x2:
			return True
		else:
			return False
	elif y5 <= y1 and y6 >= y2:
		if x5 <= x1 and x6 >= x2:
			return True
		else:
			return False
	elif (x3 <= x1 and x4 >= x2) and (x5 <= x1 and x6 >= x2):
		return True
	else:
		return False
if checkHeight() == False or checkHeight2() == False:
	print('YES')
elif checkSide() or checkSide2():
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
whiteIntersect1 = max(0, min(x2, x4) - max(x1, x3)) * max(0, min(y2, y4) - max(y1, y3))
whiteIntersect2 = max(0, min(x2, x6) - max(x1, x5)) * max(0, min(y2, y6) - max(y1, y5))
totalIntersect = max(0, min(x4, x6, x2) - max(x3, x5, x1)) * max(0, min(y4, y6, y2) - max(y1, y3, y5))
if abs(x1 - x2) * abs(y1 - y2) - (whiteIntersect2 + whiteIntersect1 - totalIntersect) <= 0:
	print('NO')
else:
	print('YES')


def intersecao(retangulo1, retangulo2):
	lista = []
	if retangulo1[0] < retangulo2[0]:
		lista.append(retangulo2[0])
	else:
		lista.append(retangulo1[0])
	if retangulo1[1] < retangulo2[1]:
		lista.append(retangulo2[1])
	else:
		lista.append(retangulo1[1])
	if retangulo1[2] > retangulo2[2]:
		lista.append(retangulo2[2])
	else:
		lista.append(retangulo1[2])
	if retangulo1[3] > retangulo2[3]:
		lista.append(retangulo2[3])
	else:
		lista.append(retangulo1[3])
	return lista

def calcularAreaRet(retangulo):
	conta1 = retangulo[2] - retangulo[0]
	conta2 = retangulo[3] - retangulo[1]
	if conta1 >= 0 and conta2 >= 0:
		return conta1 * conta2
	else:
		return 0
papelbranco = list(map(int, input().split()))
papelpretoum = list(map(int, input().split()))
papelpretodois = list(map(int, input().split()))
if calcularAreaRet(intersecao(papelbranco, papelpretoum)) + calcularAreaRet(intersecao(papelbranco, papelpretodois)) - calcularAreaRet(intersecao(papelbranco, intersecao(papelpretoum, papelpretodois))) == calcularAreaRet(papelbranco):
	print('NO')
else:
	print('YES')


import datetime

def count_time(func):

	def int_time(*args, **kwargs):
		print('*' * 10, 'Code start running!')
		start_time = datetime.datetime.now()
		func()
		over_time = datetime.datetime.now()
		total_time = (over_time - start_time).total_seconds()
		print('*' * 10, 'Total time: %s' % total_time)
	return int_time

def area(rec):
	(x1, y1, x2, y2) = rec
	return (x2 - x1) * (y2 - y1)

def compute_iou(rec1, rec2):
	S_rec1 = (rec1[2] - rec1[0]) * (rec1[3] - rec1[1])
	S_rec2 = (rec2[2] - rec2[0]) * (rec2[3] - rec2[1])
	sum_area = S_rec1 + S_rec2
	left_line = max(rec1[1], rec2[1])
	right_line = min(rec1[3], rec2[3])
	top_line = max(rec1[0], rec2[0])
	bottom_line = min(rec1[2], rec2[2])
	if left_line >= right_line or top_line >= bottom_line:
		return 0
	else:
		intersect = (right_line - left_line) * (bottom_line - top_line)
		return intersect

def min_rec(rec1, rec2):
	rec2[0] = max(rec1[0], rec2[0])
	rec2[1] = max(rec1[1], rec2[1])
	rec2[2] = min(rec1[2], rec2[2])
	rec2[3] = min(rec1[3], rec2[3])
	if rec2[0] >= rec2[2] or rec2[1] >= rec2[3]:
		return (0, 0, 0, 0)
	return rec2

def main():
	rec1 = list(map(int, input().strip().split()))
	rec2 = list(map(int, input().strip().split()))
	rec3 = list(map(int, input().strip().split()))
	rec2 = min_rec(rec1, rec2)
	rec3 = min_rec(rec1, rec3)
	a = compute_iou(rec1, rec2)
	b = compute_iou(rec1, rec3)
	c = compute_iou(rec2, rec3)
	ans = area(rec1) - a - b + c
	if ans > 0:
		print('YES')
	else:
		print('NO')
main()


def check(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6):
	if x3 <= x1 and y3 <= y1 and (x2 <= x4) and (y2 <= y4):
		return True
	if x5 <= x1 and y5 <= y1 and (x2 <= x6) and (y2 <= y6):
		return True
	if x3 <= x1 and y3 <= y1 and (y2 <= y4) and (y5 <= y1) and (y2 <= y6) and (x2 <= x6) and (x5 <= x4):
		return True
	if x3 <= x1 and y3 <= y1 and (x2 <= x4) and (x5 <= x1) and (x2 <= x6) and (y2 <= y6) and (y5 <= y4):
		return True
	return False

def main():
	try:
		while True:
			(x1, y1, x2, y2) = map(int, input().split())
			(x3, y3, x4, y4) = map(int, input().split())
			(x5, y5, x6, y6) = map(int, input().split())
			if check(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6):
				print('NO')
			elif check(x1, y1, x2, y2, x5, y5, x6, y6, x3, y3, x4, y4):
				print('NO')
			elif check(y1, x1, y2, x2, y3, x3, y4, x4, y5, x5, y6, x6):
				print('NO')
			elif check(y1, x1, y2, x2, y5, x5, y6, x6, y3, x3, y4, x4):
				print('NO')
			else:
				print('YES')
	except:
		pass
main()


def area(x1, y1, x2, y2):
	return (x2 - x1) * (y2 - y1)

def overlap_rect(x1, y1, x2, y2, x3, y3, x4, y4):
	if x3 <= x1:
		(x1, y1, x2, y2, x3, y3, x4, y4) = (x3, y3, x4, y4, x1, y1, x2, y2)
	if y3 < y1 <= y4 <= y2 and x1 <= x3 <= x2:
		if x2 < x4:
			return (x3, y1, x2, y4)
		else:
			return (x3, y1, x4, y4)
	elif y1 <= y3 <= y2 and y1 <= y4 <= y2 and (x1 <= x3 <= x2):
		if x2 < x4:
			return (x3, y3, x2, y4)
		else:
			return (x3, y3, x4, y4)
	elif y1 <= y3 <= y2 < y4 and x1 <= x3 <= x2:
		if x2 < x4:
			return (x3, y3, x2, y2)
		else:
			return (x3, y3, x4, y2)
	elif y3 <= y1 and y2 <= y4:
		if x3 <= x2:
			if x2 <= x4:
				return (x3, y1, x2, y2)
			else:
				return (x3, y1, x4, y2)
	return (0, 0, 0, 0)

def overlap_area(x1, y1, x2, y2, x3, y3, x4, y4):
	return area(*overlap_rect(x1, y1, x2, y2, x3, y3, x4, y4))

def main():
	(x1, y1, x2, y2) = (int(p) for p in input().split())
	(x3, y3, x4, y4) = (int(p) for p in input().split())
	(x5, y5, x6, y6) = (int(p) for p in input().split())
	total = area(x1, y1, x2, y2) + area(x3, y3, x4, y4) + area(x5, y5, x6, y6)
	w_b1 = overlap_area(x1, y1, x2, y2, x3, y3, x4, y4)
	w_b2 = overlap_area(x1, y1, x2, y2, x5, y5, x6, y6)
	b1_b2 = overlap_area(x3, y3, x4, y4, x5, y5, x6, y6)
	w_b1_b2 = overlap_area(*overlap_rect(x1, y1, x2, y2, x3, y3, x4, y4), *overlap_rect(x1, y1, x2, y2, x5, y5, x6, y6))
	total = total - w_b1 - w_b2 - b1_b2 + w_b1_b2
	blacks = area(x3, y3, x4, y4) + area(x5, y5, x6, y6) - b1_b2
	if total > blacks:
		print('YES')
	else:
		print('NO')
main()


w = list(map(int, input().strip().split()))
b1 = list(map(int, input().strip().split()))
b2 = list(map(int, input().strip().split()))

def intersection(a, b):
	I = [max(a[0], b[0]), max(a[1], b[1]), min(a[2], b[2]), min(a[3], b[3])]
	return I

def area(a):
	aria = max(0, a[2] - a[0]) * max(0, a[3] - a[1])
	return aria
A = area(intersection(w, b1)) + area(intersection(w, b2)) - area(intersection(w, intersection(b1, b2)))
if A == area(w):
	print('NO')
else:
	print('YES')


def area1(x1, y1, x2, y2, x3, y3, x4, y4):
	l = max(x1, x3)
	r = min(x2, x4)
	u = min(y2, y4)
	b = max(y1, y3)
	if l > r or b > u:
		return 0
	return (r - l) * (u - b)

def area2(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6):
	l = max(max(x1, x3), x5)
	r = min(min(x2, x4), x6)
	u = min(min(y2, y4), y6)
	b = max(max(y1, y3), y5)
	if l > r or b > u:
		return 0
	return (r - l) * (u - b)
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
AO = area1(x1, y1, x2, y2, x3, y3, x4, y4)
BO = area1(x1, y1, x2, y2, x5, y5, x6, y6)
ABO = area2(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6)
if AO + BO - ABO < abs(x2 - x1) * abs(y2 - y1):
	print('YES')
else:
	print('NO')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if x3 <= x1 and x4 >= x2 and (y3 <= y1) and (y4 >= y2) or (x5 <= x1 and x6 >= x2 and (y5 <= y1) and (y6 >= y2)) or (x3 <= x1 and y3 <= y1 and (y4 >= y2) and (x6 >= x2) and (y5 <= y1) and (y6 >= y2) and (x4 >= x5)) or (x5 <= x1 and y5 <= y1 and (y6 >= y2) and (x4 >= x2) and (y3 <= y1) and (y4 >= y2) and (x6 >= x3)) or (y4 >= y2 and x3 <= x1 and (x4 >= x2) and (y5 <= y1) and (x5 <= x1) and (x6 >= x2) and (y3 <= y6)) or (y6 >= y2 and x5 <= x1 and (x6 >= x2) and (y3 <= y1) and (x3 <= x1) and (x4 >= x2) and (y5 <= y4)):
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())

def dl(x1, x2, x3, x4):
	l = [x1, x2, x3, x4]
	cp = l[:]
	if sorted(cp) == l or sorted(cp) == l[2:] + l[:2]:
		return 0
	else:
		return abs(min(x2, x4) - max(x1, x3))

def tl(x1, x2, x3, x4, x5, x6):
	if dl(x1, x2, x3, x4) == 0 or dl(x1, x2, x5, x6) == 0 or dl(x5, x6, x1, x2) == 0:
		return 0
	return abs(min(x2, x4, x6) - max(x1, x3, x5))
wa = (x2 - x1) * (y2 - y1)
s = dl(x1, x2, x3, x4) * dl(y1, y2, y3, y4) + dl(x1, x2, x5, x6) * dl(y1, y2, y5, y6) - tl(x1, x2, x3, x4, x5, x6) * tl(y1, y2, y3, y4, y5, y6)
if s >= wa:
	print('NO')
else:
	print('YES')


def intersect(r1, r2):
	return [max(r1[0], r2[0]), max(r1[1], r2[1]), min(r1[2], r2[2]), min(r1[3], r2[3])]

def area(r1):
	if r1[2] < r1[0] or r1[3] < r1[1]:
		return 0
	return (r1[2] - r1[0]) * (r1[3] - r1[1])
white_rect = list(map(int, input().split()))
black_rect_1 = list(map(int, input().split()))
black_rect_2 = list(map(int, input().split()))
area_white = area(white_rect)
sub_1 = area(intersect(white_rect, black_rect_1))
sub_2 = area(intersect(white_rect, black_rect_2))
add = area(intersect(intersect(black_rect_1, black_rect_2), white_rect))
if area_white - sub_1 - sub_2 + add <= 0:
	print('NO')
else:
	print('YES')


R = lambda : [*map(int, input().split())]
(x, y, u, v) = R()
a = (b, c) = (R(), R())
(x1, x2, x3, x4) = sorted(b[::2] + c[::2])
(y1, y2, y3, y4) = sorted(b[1::2] + c[1::2])
if x2 in (b[0], c[0]) and y2 in (b[1], c[1]):
	a += ((x1, y2, x4, y3), (x2, y1, x3, y4))
r = 'YES'
for (x1, y1, x2, y2) in a:
	if x1 <= x <= u <= x2 and y1 <= y <= v <= y2:
		r = 'NO'
		break
print(r)


def inteserction(x1, y1, x2, y2, rx1, ry1, rx2, ry2):
	xo = max(0, min(x2, rx2) - max(x1, rx1))
	yo = max(0, min(y2, ry2) - max(y1, ry1))
	return xo * yo

def rect(x1, y1, x2, y2, rx1, ry1, rx2, ry2):
	(lx, ly, rx, ry) = (max(x1, rx1), max(y1, ry1), min(x2, rx2), min(y2, ry2))
	return [lx, ly, rx, ry]

def square(r):
	return (r[2] - r[0]) * (r[3] - r[1])
(x1, y1, x2, y2) = map(int, input().split())
(rx1, ry1, rx2, ry2) = map(int, input().split())
(cx1, cy1, cx2, cy2) = map(int, input().split())
tot = square([x1, y1, x2, y2])
(r1, r2) = (None, None)
if inteserction(x1, y1, x2, y2, rx1, ry1, rx2, ry2):
	r1 = rect(x1, y1, x2, y2, rx1, ry1, rx2, ry2)
if inteserction(x1, y1, x2, y2, cx1, cy1, cx2, cy2):
	r2 = rect(x1, y1, x2, y2, cx1, cy1, cx2, cy2)
if not r1 and (not r2):
	print('YES')
elif not r1:
	tot -= square(r2)
	if tot > 0:
		print('YES')
	else:
		print('NO')
elif not r2:
	tot -= square(r1)
	if tot > 0:
		print('YES')
	else:
		print('NO')
else:
	inter = inteserction(r1[0], r1[1], r1[2], r1[3], r2[0], r2[1], r2[2], r2[3])
	if inter:
		r3 = rect(r1[0], r1[1], r1[2], r1[3], r2[0], r2[1], r2[2], r2[3])
		tot -= square(r1)
		tot -= square(r2)
		tot += square(r3)
		if tot > 0:
			print('YES')
		else:
			print('NO')
	else:
		tot -= square(r1)
		tot -= square(r2)
		if tot > 0:
			print('YES')
		else:
			print('NO')


def len(a1, a2, b1, b2):
	if b1 >= a2 or a1 >= b2:
		return 0
	len = a2 - a1
	if b1 > a1 and b1 < a2:
		len -= b1 - a1
	if b2 < a2 and b2 > a1:
		len -= a2 - b2
	return len

def inter(white, black):
	l = (max(white[0], black[0]), max(white[1], black[1]))
	r = (min(white[2], black[2]), min(white[3], black[3]))
	if l[0] >= r[0] or l[1] >= r[1]:
		return [white[2], white[3], white[2], white[3]]
	else:
		return [l[0], l[1], r[0], r[1]]

def square(w, b):
	return len(w[0], w[2], b[0], b[2]) * len(w[1], w[3], b[1], b[3])

def answer(w, b1, b2):
	com = inter(w, b1)
	com = inter(com, b2)
	if square(w, w) == square(w, b1) + square(w, b2) - square(com, com):
		return 'NO'
	else:
		return 'YES'

def main():
	white = [int(s) for s in input().split()]
	black1 = [int(s) for s in input().split()]
	black2 = [int(s) for s in input().split()]
	print(answer(white, black1, black2))
main()


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

def getVars():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def getStr():
	return input().strip()

def addDictList(d, key, val):
	if key not in d:
		d[key] = []
	d[key].append(val)

def addDictInt(d, key, val):
	if key not in d:
		d[key] = 0
	d[key] = val

def addDictCount(d, key):
	if key not in d:
		d[key] = 0
	d[key] += 1

def addDictSum(d, key, val):
	if key not in d:
		d[key] = 0
	d[key] += val

def pointIn(x, y, x1, y1, x2, y2):
	res = x >= x1 and x <= x2 and (y >= y1) and (y <= y2)
	return res
(x1, y1, x2, y2) = getVars()
(x3, y3, x4, y4) = getVars()
(x5, y5, x6, y6) = getVars()
r11 = pointIn(x1, y1, x3, y3, x4, y4)
r12 = pointIn(x1, y1, x5, y5, x6, y6)
r21 = pointIn(x1, y2, x3, y3, x4, y4)
r22 = pointIn(x1, y2, x5, y5, x6, y6)
r31 = pointIn(x2, y2, x3, y3, x4, y4)
r32 = pointIn(x2, y2, x5, y5, x6, y6)
r41 = pointIn(x2, y1, x3, y3, x4, y4)
r42 = pointIn(x2, y1, x5, y5, x6, y6)
if (r11 or r12) and (r21 or r22) and (r31 or r32) and (r41 or r42):
	if r11 and r41 and r22 and r32 or (r12 and r42 and r21 and r31):
		if min(y4, y6) < max(y3, y5) and min(y4, y6) < y2 and (min(y4, y6) > y1):
			print('YES')
		else:
			print('NO')
	elif min(x4, x6) < max(x3, x5) and min(x4, x6) < x2 and (min(x4, x6) > x1):
		print('YES')
	else:
		print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
(c1, c2, cc) = (0, 0, 0)
if max(x1, x3) < min(x2, x4) and max(y1, y3) < min(y2, y4):
	c1 = (min(x2, x4) - max(x1, x3)) * (min(y2, y4) - max(y1, y3))
if max(x1, x5) < min(x2, x6) and max(y1, y5) < min(y2, y6):
	c2 = (min(x2, x6) - max(x1, x5)) * (min(y2, y6) - max(y1, y5))
if c1 > 0 and c2 > 0:
	if max(x3, x5) < min(x4, x6) and max(y3, y5) < min(y4, y6):
		z1 = max(x1, max(x3, x5))
		w1 = max(y1, max(y3, y5))
		z2 = min(x2, min(x4, x6))
		w2 = min(y2, min(y4, y6))
		if z1 < z2 and w1 < w2:
			cc = abs(z2 - z1) * abs(w2 - w1)
c = abs(x2 - x1) * abs(y2 - y1)
if c > c1 + c2 - cc:
	print('YES')
else:
	print('NO')


def inter(x1, y1, x2, y2, x3, y3, x4, y4):
	m = min(x2, x4) - max(x1, x3)
	r = min(y2, y4) - max(y1, y3)
	if min(m, r) > 0:
		return m * r
	else:
		return 0
(x1, y1, x2, y2) = map(int, input().split())
ar1 = (x2 - x1) * (y2 - y1)
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if inter(x1, y1, x2, y2, x3, y3, x4, y4) >= ar1 or inter(x1, y1, x2, y2, x5, y5, x6, y6) >= ar1:
	print('NO')
else:
	if x3 <= x1 and x4 >= x2 and (inter(x1, y1, x2, y2, x3, y3, x4, y4) > 0):
		x1 = x1
		x2 = x2
		if y3 <= y1:
			y1 = y4
		elif y4 < y2:
			print('YES')
			exit()
		else:
			y2 = y3
		are = (x2 - x1) * (y2 - y1)
		if inter(x1, y1, x2, y2, x5, y5, x6, y6) >= are:
			print('NO')
			exit()
		else:
			print('YES')
			exit()
	if y3 <= y1 and y4 >= y2 and (inter(x1, y1, x2, y2, x3, y3, x4, y4) > 0):
		y1 = y1
		y2 = y2
		if x3 <= x1:
			x1 = x4
		elif x4 < x2:
			print('YES')
			exit()
		else:
			x2 = x3
		are = (x2 - x1) * (y2 - y1)
		if inter(x1, y1, x2, y2, x5, y5, x6, y6) >= are:
			print('NO')
			exit()
		else:
			print('YES')
			exit()
	if x5 <= x1 and x6 >= x2 and (inter(x1, y1, x2, y2, x5, y5, x6, y6) > 0):
		x1 = x1
		x2 = x2
		if y5 <= y1:
			y1 = y6
		elif y6 < y2:
			print('YES')
			exit()
		else:
			y2 = y5
		are = (x2 - x1) * (y2 - y1)
		if inter(x1, y1, x2, y2, x3, y3, x4, y4) >= are:
			print('NO')
			exit()
		else:
			print('YES')
			exit()
	if y5 <= y1 and y6 >= y2 and (inter(x1, y1, x2, y2, x5, y5, x6, y6) > 0):
		y1 = y1
		y2 = y2
		if x5 <= x1:
			x1 = x6
		elif x6 < x2:
			print('YES')
			exit()
		else:
			x2 = x5
		are = (x2 - x1) * (y2 - y1)
		if inter(x1, y1, x2, y2, x3, y3, x4, y4) >= are:
			print('NO')
			exit()
		else:
			print('YES')
			exit()
	print('YES')


from sys import stdin
(x0, y0, x1, y1) = map(int, stdin.readline().strip().split())
(x2, y2, x3, y3) = map(int, stdin.readline().strip().split())
(x4, y4, x5, y5) = map(int, stdin.readline().strip().split())
flag = False
if x2 <= x0 and x3 >= x1 or (y2 <= y0 and y3 >= y1):
	if (x2 <= x0 and x3 >= x1) and (y2 <= y0 and y3 >= y1):
		flag = True
	if x2 <= x0 and x3 >= x1:
		if y2 <= y0 and y3 >= y0:
			y0 = y3
		elif y3 >= y1 and y2 <= y1:
			y1 = y2
	elif y2 <= y0 and y3 >= y1:
		if x2 <= x0 and x3 >= x0:
			x0 = x3
		elif x3 >= x1 and x2 <= x1:
			x1 = x2
if (x4 <= x0 and x5 >= x1) and (y4 <= y0 and y5 >= y1):
	flag = True
if not flag:
	print('YES')
else:
	print('NO')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
res_x1 = max(0, min(x2, x4) - max(x1, x3))
res_y1 = max(0, min(y2, y4) - max(y1, y3))
res_x2 = max(0, min(x2, x6) - max(x1, x5))
res_y2 = max(0, min(y2, y6) - max(y1, y5))
res_x0 = max(0, min(x6, x2, x4) - max(x1, x3, x5))
res_y0 = max(0, min(y2, y4, y6) - max(y1, y3, y5))
if res_x1 * res_y1 + res_x2 * res_y2 - res_x0 * res_y0 >= (x2 - x1) * (y2 - y1):
	print('NO')
else:
	print('YES')


def inside_rect(q, tl, br):
	(qx, qy) = q
	(tlx, tly) = tl
	(brx, bry) = br
	return (tlx <= qx) == (qx <= brx) and (tly <= qy) == (qy <= bry)

def mid_point(p1, p2):
	return [(c1 + c2) / 2 for (c1, c2) in zip(p1, p2)]

def main():
	(x1, y1, x2, y2) = [int(x) for x in input().split(' ')]
	w1 = (x1, y1)
	w2 = (x1, y2)
	w3 = (x2, y1)
	w4 = (x2, y2)
	(x1, y1, x2, y2) = [int(x) for x in input().split(' ')]
	b1 = (x1, y1)
	b2 = (x1, y2)
	b3 = (x2, y1)
	b4 = (x2, y2)
	(x1, y1, x2, y2) = [int(x) for x in input().split(' ')]
	c1 = (x1, y1)
	c2 = (x1, y2)
	c3 = (x2, y1)
	c4 = (x2, y2)
	(xs, ys) = zip(w1, w4, b1, b4, c1, c4)
	points_to_check = [(x + dx, y + dy) for x in xs for y in ys for dx in [-0.1, 0.1] for dy in [-0.1, 0.1]]
	for p in points_to_check:
		in_white = inside_rect(p, w1, w4)
		in_black1 = inside_rect(p, b1, b4)
		in_black2 = inside_rect(p, c1, c4)
		if in_white and (not in_black1) and (not in_black2):
			print('YES')
			return
	print('NO')
main()


import math
(x1, y1, x11, y11) = map(int, input().split())
(x2, y2, x22, y22) = map(int, input().split())
(x3, y3, x33, y33) = map(int, input().split())
l = []
l.append([x1, y1, x11, y11])
for i in [x2, x22, x3, x33]:
	n = len(l)
	for j in range(n):
		rect = l[j]
		if i > rect[0] and i < rect[2]:
			x = rect[2]
			l[j][2] = i
			l.append([i, l[j][1], x, l[j][3]])
for i in [y2, y22, y3, y33]:
	n = len(l)
	for j in range(n):
		rect = l[j]
		if i > rect[1] and i < rect[3]:
			x = rect[3]
			l[j][3] = i
			l.append([l[j][0], i, l[j][2], x])
to_remove = set()
for j in range(len(l)):
	i = l[j]
	if i[0] >= x2 and i[1] >= y2 and (i[2] <= x22) and (i[3] <= y22) or (i[0] >= x3 and i[1] >= y3 and (i[2] <= x33) and (i[3] <= y33)):
		to_remove.add(j)
if len(l) - len(to_remove) > 0:
	print('YES')
else:
	print('NO')


x = list(map(int, input().split(' ')))
(x1, y1, x2, y2) = (x[0], x[1], x[2], x[3])
x = list(map(int, input().split(' ')))
(x3, y3, x4, y4) = (x[0], x[1], x[2], x[3])
x = list(map(int, input().split(' ')))
(x5, y5, x6, y6) = (x[0], x[1], x[2], x[3])
if x3 <= x1 and x4 >= x2 and (y3 <= y1) and (y4 >= y2) or (x5 <= x1 and x6 >= x2 and (y5 <= y1) and (y6 >= y2)):
	print('NO')
elif (x3 <= x1 and x4 >= x2 and (x5 <= x1) and (x6 >= x2)) and (y4 >= y2 and y5 <= y1 and (y3 <= y6) or (y3 <= y1 and y6 >= y2 and (y5 <= y4))):
	print('NO')
elif (y3 <= y1 and y4 >= y2 and (y5 <= y1) and (y6 >= y2)) and (x4 >= x2 and x5 <= x1 and (x3 <= x6) or (x3 <= x1 and x6 >= x2 and (x5 <= x4))):
	print('NO')
else:
	print('YES')


W = list(map(int, input().split()))
B1 = list(map(int, input().split()))
B2 = list(map(int, input().split()))

def union(A, B, C=None):
	(Aleft, Abottom, Aright, Atop) = A
	(Bleft, Bbottom, Bright, Btop) = B
	if C != None:
		(Cleft, Cbottom, Cright, Ctop) = C
		if (Bleft < Cright and Bright > Cleft) and (Bbottom < Ctop and Btop > Cbottom):
			Bleft = max(Bleft, Cleft)
			Bright = min(Bright, Cright)
			Bbottom = max(Bbottom, Cbottom)
			Btop = min(Btop, Ctop)
		else:
			(Bleft, Bbottom, Bright, Btop) = (0, 0, 0, 0)
	if (Aleft < Bright and Aright > Bleft) and (Abottom < Btop and Atop > Bbottom):
		width = min(Aright, Bright) - max(Aleft, Bleft)
		height = min(Atop, Btop) - max(Abottom, Bbottom)
		return width * height
	else:
		return 0
if union(W, B1) + union(W, B2) - union(W, B1, B2) == (W[2] - W[0]) * (W[3] - W[1]):
	print('NO')
else:
	print('YES')


def area(r1, r2):
	(x1, y1, x2, y2, a1, b1, a2, b2) = r1 + r2
	return max(0, min(y2, b2) - max(y1, b1)) * max(0, min(x2, a2) - max(x1, a1))
(*r1,) = map(int, input().split())
(*r2,) = map(int, input().split())
(*r3,) = map(int, input().split())
r4 = [max(r2[0], r3[0]), max(r2[1], r3[1]), min(r2[2], r3[2]), min(r2[3], r3[3])]
print('YNEOS'[area(r1, r2) + area(r1, r3) - area(r1, r4) >= (r1[2] - r1[0]) * (r1[3] - r1[1])::2])


class Rectangle:

	def __init__(self, x1, y1, x2, y2):
		self.x1 = x1
		self.y1 = y1
		self.x2 = x2
		self.y2 = y2

	def area(self):
		return (self.x2 - self.x1) * (self.y2 - self.y1)

def intersection(a, b):
	overlapY = max(min(a.y2, b.y2) - max(a.y1, b.y1), 0)
	overlapX = max(min(a.x2, b.x2) - max(a.x1, b.x1), 0)
	return overlapX * overlapY

def intersection3(a, b, c):
	overlapY = max(min(min(a.y2, b.y2), c.y2) - max(max(a.y1, b.y1), c.y1), 0)
	overlapX = max(min(min(a.x2, b.x2), c.x2) - max(max(a.x1, b.x1), c.x1), 0)
	return overlapY * overlapX

def main():
	(x1, y1, x2, y2) = map(int, input().split())
	w = Rectangle(x1, y1, x2, y2)
	(x1, y1, x2, y2) = map(int, input().split())
	b1 = Rectangle(x1, y1, x2, y2)
	(x1, y1, x2, y2) = map(int, input().split())
	b2 = Rectangle(x1, y1, x2, y2)
	if w.area() - intersection(w, b1) == 0 or w.area() - intersection(w, b2) == 0:
		print('NO')
	elif w.area() > intersection(w, b1) + intersection(w, b2) - intersection3(b1, b2, w):
		print('YES')
	else:
		print('NO')
main()


def isInside(x, y, x1, y1, x2, y2):
	return x < x1 or x > x2 or y < y1 or (y > y2)

def fun(x):
	return 2 * int(x)
(x1, y1, x2, y2) = list(map(fun, input().strip().split()))
(x3, y3, x4, y4) = list(map(fun, input().strip().split()))
(x5, y5, x6, y6) = list(map(fun, input().strip().split()))
for x in range(x1, x2 + 1):
	if isInside(x, y1, x3, y3, x4, y4) and isInside(x, y1, x5, y5, x6, y6):
		print('YES')
		exit(0)
	if isInside(x, y2, x3, y3, x4, y4) and isInside(x, y2, x5, y5, x6, y6):
		print('YES')
		exit(0)
for y in range(y1, y2 + 1):
	if isInside(x1, y, x3, y3, x4, y4) and isInside(x1, y, x5, y5, x6, y6):
		print('YES')
		exit(0)
	if isInside(x2, y, x3, y3, x4, y4) and isInside(x2, y, x5, y5, x6, y6):
		print('YES')
		exit(0)
print('NO')


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
import bisect
from heapq import *
from math import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def bs(a, l, h, x):
	while l < h:
		mid = (l + h) // 2
		if a[mid] == x:
			return mid
		if a[mid] < x:
			l = mid + 1
		else:
			h = mid
	return l

def sieve(a):
	for i in range(3, 10 ** 6 + 1, 2):
		a[i] = 1
	for i in range(3, 10 ** 6 + 1, 2):
		for j in range(i * i, 10 ** 6 + 1, i):
			a[j] = 0
	a[2] = 1
	return a

def bfs(g, st):
	visited = [0] * len(g)
	visited[st] = 1
	queue = []
	queue.append(st)
	new = []
	while len(queue) != 0:
		s = queue.pop()
		new.append(s)
		for i in g[s]:
			if visited[i] == 0:
				visited[i] = 1
				queue.append(i)
	return new

def intersection(a, b):
	I = [max(a[0], b[0]), max(a[1], b[1]), min(a[2], b[2]), min(a[3], b[3])]
	return I

def area(a):
	aria = max(0, a[2] - a[0]) * max(0, a[3] - a[1])
	return aria

def solve():
	a = lis()
	b = lis()
	c = lis()
	if area(intersection(a, b)) + area(intersection(a, c)) - area(intersection(a, intersection(b, c))) == area(a):
		print('NO')
	else:
		print('YES')
testcase(1)


(*P,) = map(int, input().split())
(*Q1,) = map(int, input().split())
(*Q2,) = map(int, input().split())

def contains(P, Q):
	(x1, y1, x2, y2) = P
	(x3, y3, x4, y4) = Q
	return x3 <= x1 and x2 <= x4 and (y3 <= y1) and (y2 <= y4)

def containsY(P, Q, y):
	(x1, y1, x2, y2) = P
	(x3, y3, x4, y4) = Q
	assert y1 == y or y2 == y
	return y3 <= y <= y4 and x3 <= x1 and (x2 <= x4)

def containsX(P, Q, x):
	(x1, y1, x2, y2) = P
	(x3, y3, x4, y4) = Q
	assert x1 == x or x2 == x
	return x3 <= x <= x4 and y3 <= y1 and (y2 <= y4)

def check(P, Q1, Q2):
	if contains(P, Q1) or contains(P, Q2):
		return 0
	(x1, y1, x2, y2) = P
	(x3, y3, x4, y4) = Q1
	(x5, y5, x6, y6) = Q2
	if containsY(P, Q1, y1) and containsY(P, Q2, y2):
		if y5 <= y4:
			return 0
	if containsY(P, Q1, y2) and containsY(P, Q2, y1):
		if y3 <= y6:
			return 0
	if containsX(P, Q1, x1) and containsX(P, Q2, x2):
		if x5 <= x4:
			return 0
	if containsX(P, Q1, x2) and containsX(P, Q2, x1):
		if x3 <= x6:
			return 0
	return 1
if check(P, Q1, Q2):
	print('YES')
else:
	print('NO')


def inside(c, a, b):
	if c >= a and c <= b:
		return True
	else:
		return False

def insideSqe(x, y, xl, xr, yd, yu):
	if inside(x, xl, xr) and inside(y, yd, yu):
		return True
	else:
		return False
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
flagX = False
flagY = False
flag1 = False
flag2 = False
flag3 = False
flag4 = False
X = list()
if inside(x5, x3, x4):
	X.append([x3, max(x6, x4)])
elif inside(x6, x3, x4):
	X.append([min(x5, x3), x4])
else:
	X.append([x3, x4])
	X.append([x5, x6])
for i in X:
	if x1 >= i[0] and x2 <= i[1]:
		flagX = True
Y = list()
if inside(y5, y3, y4):
	Y.append([y3, max(y6, y4)])
elif inside(y6, y3, y4):
	Y.append([min(y5, y3), y4])
else:
	Y.append([y3, y4])
	Y.append([y5, y6])
for i in Y:
	if y1 >= i[0] and y2 <= i[1]:
		flagY = True
flag1 |= insideSqe(x1, y1, x3, x4, y3, y4)
flag1 |= insideSqe(x1, y1, x5, x6, y5, y6)
flag2 |= insideSqe(x2, y2, x3, x4, y3, y4)
flag2 |= insideSqe(x2, y2, x5, x6, y5, y6)
flag3 |= insideSqe(x1, y2, x3, x4, y3, y4)
flag3 |= insideSqe(x1, y2, x5, x6, y5, y6)
flag4 |= insideSqe(x2, y1, x3, x4, y3, y4)
flag4 |= insideSqe(x2, y1, x5, x6, y5, y6)
if flag1 & flag2 & flag3 & flag4 & flagY & flagX:
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())

def do_mask(x1, y1, x2, y2, x3, y3, x4, y4):
	if x1 == -1:
		return (-1, -1, -1, -1)
	if x3 <= x1 and x2 <= x4 and (y3 <= y1) and (y2 <= y4):
		return (-1, -1, -1, -1)
	if x3 <= x1 and x2 <= x4:
		if y3 <= y1 and y1 <= y4:
			y1 = y4
		if y3 <= y2 and y2 <= y4:
			y2 = y3
	if y3 <= y1 and y2 <= y4:
		if x3 <= x1 and x1 <= x4:
			x1 = x4
		if x3 <= x2 and x2 <= x4:
			x2 = x3
	return (x1, y1, x2, y2)
(x1, y1, x2, y2) = do_mask(x1, y1, x2, y2, x3, y3, x4, y4)
(x1, y1, x2, y2) = do_mask(x1, y1, x2, y2, x5, y5, x6, y6)
print('NO' if x1 == -1 else 'YES')


class Rect:

	def __init__(self, a, b, c, d):
		(self.x1, self.y1) = (a, b)
		(self.x2, self.y2) = (c, d)

	def get_intersect(self, tar_rect):
		nw_rect = Rect(0, 0, 0, 0)
		nw_rect.x1 = max(self.x1, tar_rect.x1)
		nw_rect.y1 = max(self.y1, tar_rect.y1)
		nw_rect.x2 = min(self.x2, tar_rect.x2)
		nw_rect.y2 = min(self.y2, tar_rect.y2)
		if nw_rect.x1 > nw_rect.x2 or nw_rect.y1 > nw_rect.y2:
			nw_rect = Rect(0, 0, 0, 0)
		return nw_rect

	def get_area(self):
		(r, c) = (self.y2 - self.y1, self.x2 - self.x1)
		return r * c
rects = []
for i in range(3):
	rc = Rect(*list(map(int, input().split())))
	rects.append(rc)
r1 = rects[0].get_intersect(rects[1])
r2 = rects[0].get_intersect(rects[2])
r3 = r1.get_intersect(r2)
tar_a = rects[0].get_area()
if r1.get_area() + r2.get_area() - r3.get_area() < tar_a:
	print('YES')
else:
	print('NO')


(x1, y1, x2, y2) = (0, 1, 2, 3)

def square(r):
	return (r[x2] - r[x1]) * (r[y2] - r[y1])

def intersection(r1, r2):
	(rx1, ry1, rx2, ry2) = (max(r1[x1], r2[x1]), max(r1[y1], r2[y1]), min(r1[x2], r2[x2]), min(r1[y2], r2[y2]))
	if rx1 > rx2 or ry1 > ry2:
		return (0, 0, 0, 0)
	return (rx1, ry1, rx2, ry2)
white = tuple(map(int, input().split()))
black1 = tuple(map(int, input().split()))
black2 = tuple(map(int, input().split()))
i1 = intersection(white, black1)
i2 = intersection(white, black2)
ii = intersection(i1, i2)
if square(i1) + square(i2) - square(ii) >= square(white):
	print('NO')
else:
	print('YES')


(w_x1, w_y1, w_x2, w_y2) = list(map(int, input().split()))
(x1, y1, x2, y2) = list(map(int, input().split()))
if x1 <= w_x1 and w_x2 <= x2:
	if y1 <= w_y1:
		w_y1 = max(y2, w_y1)
	if y2 >= w_y2:
		w_y2 = min(y1, w_y2)
if y1 <= w_y1 and w_y2 <= y2:
	if x1 <= w_x1:
		w_x1 = max(x2, w_x1)
	if x2 >= w_x2:
		w_x2 = min(x1, w_x2)
(x1, y1, x2, y2) = list(map(int, input().split()))
if x1 <= w_x1 and w_x2 <= x2:
	if y1 <= w_y1:
		w_y1 = max(y2, w_y1)
	if y2 >= w_y2:
		w_y2 = min(y1, w_y2)
if y1 <= w_y1 and w_y2 <= y2:
	if x1 <= w_x1:
		w_x1 = max(x2, w_x1)
	if x2 >= w_x2:
		w_x2 = min(x1, w_x2)
if w_x1 >= w_x2 and w_y1 >= w_y2:
	print('NO')
else:
	print('YES')


def out1(x, y):
	return not (x3 <= x <= x4 and y3 <= y <= y4)

def out2(x, y):
	return not (x5 <= x <= x6 and y5 <= y <= y6)
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
flag = False
y = y1
while y <= y2:
	flag |= out1(x1, y) and out2(x1, y)
	flag |= out1(x2, y) and out2(x2, y)
	y += 0.5
x = x1
while x <= x2:
	flag |= out1(x, y1) and out2(x, y1)
	flag |= out1(x, y2) and out2(x, y2)
	x += 0.5
if flag:
	print('YES')
else:
	print('NO')


def square(n, rectangles):
	rectangles.sort()
	maxX1 = float('-inf')
	maxY1 = float('-inf')
	minX2 = float('inf')
	minY2 = float('inf')
	for i in range(n):
		maxX1 = max(rectangles[i][0], maxX1)
		maxY1 = max(maxY1, rectangles[i][1])
		minX2 = min(rectangles[i][2], minX2)
		minY2 = min(rectangles[i][3], minY2)
	if maxX1 <= minX2 and minY2 >= maxY1:
		return (minX2 - maxX1) * (minY2 - maxY1)
	return 0
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if (x2 - x1) * (y2 - y1) - square(2, [[x1, y1, x2, y2], [x3, y3, x4, y4]]) - square(2, [[x1, y1, x2, y2], [x5, y5, x6, y6]]) + square(3, [[x1, y1, x2, y2], [x3, y3, x4, y4], [x5, y5, x6, y6]]) > 0:
	print('YES')
else:
	print('NO')


a = [list(map(int, input().split())) for _ in range(3)]

def area(v):
	return max(0, v[2] - v[0]) * max(0, v[3] - v[1])

def clip(v1, v2):
	return [max(v1[0], v2[0]), max(v1[1], v2[1]), min(v1[2], v2[2]), min(v1[3], v2[3])]
print('YES' if area(clip(a[0], a[1])) + area(clip(a[0], a[2])) - area(clip(a[0], clip(a[1], a[2]))) < area(a[0]) else 'NO')


def calc(x, y, b):
	(x1, y1, x2, y2) = b
	return x < x1 or x2 < x or y < y1 or (y > y2)
w = list(map(int, input().split()))
b1 = list(map(int, input().split()))
b2 = list(map(int, input().split()))
for i in range(4):
	w[i] *= 2
	b1[i] *= 2
	b2[i] *= 2
ans = 'NO'
for i in range(w[0], w[2] + 1):
	if calc(i, w[1], b1) and calc(i, w[1], b2):
		ans = 'YES'
		break
	if calc(i, w[3], b2) and calc(i, w[3], b1):
		ans = 'YES'
		break
if ans == 'YES':
	print(ans)
	exit()
for i in range(w[1], w[3] + 1):
	if calc(w[0], i, b1) and calc(w[0], i, b2):
		ans = 'YES'
		break
	if calc(w[2], i, b2) and calc(w[2], i, b1):
		ans = 'YES'
		break
print(ans)


rects = []
for i in range(3):
	rects.append([int(x) for x in input().split()])

def completeCoverUp(a, b):
	if b[0] <= a[0] <= b[2] and b[0] <= a[2] <= b[2] and (b[1] <= a[1] <= b[3]) and (b[1] <= a[3] <= b[3]):
		return True
	else:
		return False

def fullIntersect(a, b):
	if b[1] <= a[1] <= b[3] and b[0] <= a[0] <= b[2] and (b[0] <= a[2] <= b[2]):
		return [a[0], b[3], a[2], a[3]]
	elif b[1] <= a[3] <= b[3] and b[0] <= a[0] <= b[2] and (b[0] <= a[2] <= b[2]):
		return [a[0], a[1], a[2], b[1]]
	elif b[0] <= a[0] <= b[2] and b[1] <= a[3] <= b[3] and (b[1] <= a[1] <= b[3]):
		return [b[2], a[1], a[2], a[3]]
	elif b[0] <= a[2] <= b[2] and b[1] <= a[3] <= b[3] and (b[1] <= a[1] <= b[3]):
		return [a[0], a[1], b[0], a[3]]
	else:
		return a
if completeCoverUp(rects[0], rects[1]) or completeCoverUp(rects[0], rects[2]):
	print('NO')
else:
	remainingRect = fullIntersect(rects[0], rects[1])
	if completeCoverUp(remainingRect, rects[2]):
		print('NO')
	else:
		print('YES')


white = input('').split(' ')
black1 = input('').split(' ')
black2 = input('').split(' ')
x1 = int(white[0])
y1 = int(white[1])
x2 = int(white[2])
y2 = int(white[3])
x3 = int(black1[0])
y3 = int(black1[1])
x4 = int(black1[2])
y4 = int(black1[3])
x5 = int(black2[0])
y5 = int(black2[1])
x6 = int(black2[2])
y6 = int(black2[3])
if x1 >= x3 and y1 >= y3 and (x2 <= x4) and (y2 <= y4):
	print('NO')
	exit(0)
elif x1 >= x5 and y1 >= y5 and (x2 <= x6) and (y2 <= y6):
	print('NO')
	exit(0)
if y3 > y5:
	if x3 <= x1 and x4 >= x2 and (x5 <= x1) and (x6 >= x2) and (y3 <= y6) and (y4 >= y2) and (y5 <= y1):
		print('NO')
		exit(0)
elif x3 <= x1 and x4 >= x2 and (x5 <= x1) and (x6 >= x2) and (y5 <= y4) and (y6 >= y2) and (y3 <= y1):
	print('NO')
	exit(0)
if x5 > x3:
	if x3 <= x1 and y1 >= y3 and (y2 <= y4) and (x4 >= x5) and (y2 <= y6) and (y1 >= y5) and (x2 <= x6):
		print('NO')
		exit(0)
elif x5 <= x1 and y1 >= y5 and (y2 <= y6) and (x6 >= x3) and (y2 <= y4) and (y1 >= y5) and (x2 <= x4):
	print('NO')
	exit(0)
print('YES')


(x1, y1, x2, y2) = [int(i) for i in input().split()]
(x3, y3, x4, y4) = [int(i) for i in input().split()]
(x5, y5, x6, y6) = [int(i) for i in input().split()]

def intersection(a1, a2, b1, b2, c1, c2, d1, d2):
	if max(a1, b1, c1, d1) - min(a1, b1, c1, d1) >= b1 - a1 + (d1 - c1) or max(a2, b2, c2, d2) - min(a2, b2, c2, d2) >= b2 - a2 + (d2 - c2):
		return 0
	else:
		x1 = b1 - a1 + (d1 - c1) - (max(a1, b1, c1, d1) - min(a1, b1, c1, d1))
		x2 = b2 - a2 + (d2 - c2) - (max(a2, b2, c2, d2) - min(a2, b2, c2, d2))
		return x1 * x2
S = (x2 - x1) * (y2 - y1)
S1 = intersection(x1, y1, x2, y2, x3, y3, x4, y4)
S2 = intersection(x1, y1, x2, y2, x5, y5, x6, y6)
S3 = intersection(max(x3, x5), max(y3, y5), min(x4, x6), min(y4, y6), x1, y1, x2, y2)
if S == S1 + S2 - S3:
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = (int(i) for i in input().split())
(x3, y3, x4, y4) = (int(i) for i in input().split())
(x5, y5, x6, y6) = (int(i) for i in input().split())
ans = False
if y3 <= y1 and y2 <= y4:
	if x3 <= x1:
		if x4 >= x2:
			ans = True
		elif x1 <= x4 <= x2:
			x1 = x4
	elif x1 <= x3 <= x2:
		if x4 >= x2:
			x2 = x3
if x3 <= x1 and x2 <= x4:
	if y3 <= y1:
		if y4 >= y2:
			ans = True
		elif y1 <= y4 <= y2:
			y1 = y4
	elif y1 <= y3 <= y2:
		if y4 >= y2:
			y2 = y3
ans = True if x5 <= x1 and x2 <= x6 and (y5 <= y1) and (y2 <= y6) else ans
print('NO' if ans else 'YES')


w = list(map(int, input().split()))
b1 = list(map(int, input().split()))
b2 = list(map(int, input().split()))

def inside(x, y, rect):
	return rect[0] <= x and x <= rect[2] and (rect[1] <= y) and (y <= rect[3])
b1_cover = [inside(w[0], w[1], b1), inside(w[0], w[3], b1), inside(w[2], w[3], b1), inside(w[2], w[1], b1)]
b2_cover = [inside(w[0], w[1], b2), inside(w[0], w[3], b2), inside(w[2], w[3], b2), inside(w[2], w[1], b2)]
if any((not (b1_cover[i] or b2_cover[i]) for i in range(4))):
	print('YES')
	exit(0)
if not all(b1_cover) and (not all(b2_cover)):
	if b1[2] < b2[0] or b2[2] < b1[0] or b1[3] < b2[1] or (b2[3] < b1[1]):
		print('Yes')
		exit(0)
print('NO')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
(x1, y1, x2, y2) = (x1 * 2, y1 * 2, x2 * 2, y2 * 2)
(x3, y3, x4, y4) = (x3 * 2, y3 * 2, x4 * 2, y4 * 2)
(x5, y5, x6, y6) = (x5 * 2, y5 * 2, x6 * 2, y6 * 2)
flag = 0
for x in range(x1, x2 + 1):
	if not (x3 <= x <= x4 and y3 <= y1 <= y4 or (x5 <= x <= x6 and y5 <= y1 <= y6)) or not (x3 <= x <= x4 and y3 <= y2 <= y4 or (x5 <= x <= x6 and y5 <= y2 <= y6)):
		flag = 1
for y in range(y1, y2 + 1):
	if not (y3 <= y <= y4 and x3 <= x1 <= x4 or (y5 <= y <= y6 and x5 <= x1 <= x6)) or not (y3 <= y <= y4 and x3 <= x2 <= x4 or (y5 <= y <= y6 and x5 <= x2 <= x6)):
		flag = 1
if flag:
	print('YES')
else:
	print('NO')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if x3 <= x1 and y3 <= y1 and (x2 <= x4) and (y2 <= y4):
	print('NO')
elif x5 <= x1 and y5 <= y1 and (x2 <= x6) and (y2 <= y6):
	print('NO')
else:
	if y3 <= y1:
		if x3 <= x1 and x2 <= x4:
			y1 = max(y1, y4)
	elif y2 <= y4:
		if x3 <= x1 and x2 <= x4:
			y2 = min(y2, y3)
	if x3 <= x1:
		if y3 <= y1 and y2 <= y4:
			x1 = max(x1, x4)
	elif x2 <= x4:
		if y3 <= y1 and y2 <= y4:
			x2 = min(x2, x3)
	if x5 <= x1 and y5 <= y1 and (x2 <= x6) and (y2 <= y6):
		print('NO')
	else:
		print('YES')


def int_area(x1, y1, x2, y2, x3, y3, x4, y4):
	x3 = min(max(x1, x3), x2)
	x4 = min(max(x1, x4), x2)
	y3 = min(max(y1, y3), y2)
	y4 = min(max(y1, y4), y2)
	return (x4 - x3) * (y4 - y3)
(x1, y1, x2, y2) = [int(k) for k in input().split(' ')]
(x3, y3, x4, y4) = [int(k) for k in input().split(' ')]
(x5, y5, x6, y6) = [int(k) for k in input().split(' ')]
x3 = min(max(x1, x3), x2)
x5 = min(max(x1, x5), x2)
x4 = min(max(x1, x4), x2)
x6 = min(max(x1, x6), x2)
y3 = min(max(y1, y3), y2)
y5 = min(max(y1, y5), y2)
y4 = min(max(y1, y4), y2)
y6 = min(max(y1, y6), y2)
tia = int_area(x1, y1, x2, y2, x3, y3, x4, y4) + int_area(x1, y1, x2, y2, x5, y5, x6, y6) - int_area(x3, y3, x4, y4, x5, y5, x6, y6)
if tia == (x2 - x1) * (y2 - y1):
	print('NO')
else:
	print('YES')


def intersection(a, b):
	return (max(a[0], b[0]), max(a[1], b[1]), min(a[2], b[2]), min(a[3], b[3]))

def area(lst):
	return max(lst[2] - lst[0], 0) * max(lst[3] - lst[1], 0)
wh = [int(i) for i in input().split()]
lst_1 = [int(i) for i in input().split()]
lst_2 = [int(i) for i in input().split()]
covered_area = area(intersection(wh, lst_1)) + area(intersection(wh, lst_2)) - area(intersection(wh, intersection(lst_1, lst_2)))
print('NO' if covered_area == area(wh) else 'YES')


import copy

def point_inside(x, y, rect):
	return rect['x1'] <= x <= rect['x2'] and rect['y1'] <= y <= rect['y2']

def white_in_one_black(w, a):
	return point_inside(w['x1'], w['y1'], a) and point_inside(w['x1'], w['y2'], a) and point_inside(w['x2'], w['y1'], a) and point_inside(w['x2'], w['y2'], a)

def white_in_two_black(w, a, b):

	def point_in_one_rect(x, y, a, b):
		return point_inside(x, y, a) or point_inside(x, y, b)
	return point_in_one_rect(w['x1'], w['y1'], a, b) and point_in_one_rect(w['x1'], w['y2'], a, b) and point_in_one_rect(w['x2'], w['y1'], a, b) and point_in_one_rect(w['x2'], w['y2'], a, b)

def black_is_continous(a, b):

	def any_one_point_inside(a, b):
		return point_inside(a['x1'], a['y1'], b) or point_inside(a['x1'], a['y2'], b) or point_inside(a['x2'], a['y1'], b) or point_inside(a['x2'], a['y2'], b)
	return any_one_point_inside(a, b) or any_one_point_inside(b, a)
(wx1, wy1, wx2, wy2) = map(int, input().split())
(ax1, ay1, ax2, ay2) = map(int, input().split())
(bx1, by1, bx2, by2) = map(int, input().split())
w = {'x1': wx1, 'x2': wx2, 'y1': wy1, 'y2': wy2}
a = {'x1': ax1, 'x2': ax2, 'y1': ay1, 'y2': ay2}
b = {'x1': bx1, 'x2': bx2, 'y1': by1, 'y2': by2}

def main(w, a, b):
	if white_in_one_black(w, a) or white_in_one_black(w, b):
		return True
	if not white_in_two_black(w, a, b):
		return False
	return black_is_continous(a, b)
res = main(w, a, b)
print('NO' if res else 'YES')


MI = lambda : map(int, input().split())
(x1, y1, x2, y2) = MI()
(x3, y3, x4, y4) = MI()
(x5, y5, x6, y6) = MI()

def inter(p1, p2, p3, p4, p5, p6):
	li = max(p1[0], p3[0], p5[0])
	ld = min(p2[0], p4[0], p6[0])
	la = min(p2[1], p4[1], p6[1])
	lab = max(p1[1], p3[1], p5[1])
	return 0 if ld <= li or la <= lab else (ld - li) * (la - lab)
areablanca = inter((x1, y1), (x2, y2), (x1, y1), (x2, y2), (x1, y1), (x2, y2))
bn1 = inter((x1, y1), (x2, y2), (x1, y1), (x2, y2), (x3, y3), (x4, y4))
bn2 = inter((x1, y1), (x2, y2), (x1, y1), (x2, y2), (x5, y5), (x6, y6))
bn1n2 = inter((x1, y1), (x2, y2), (x3, y3), (x4, y4), (x5, y5), (x6, y6))
print('NO') if areablanca == bn1 + bn2 - bn1n2 else print('YES')


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import *
(x1, y1, x2, y2) = I()
(a1, b1, a2, b2) = I()
(u1, v1, u2, v2) = I()
(a1, b1, a2, b2) = [max(x1, a1), max(y1, b1), min(x2, a2), min(y2, b2)]
(u1, v1, u2, v2) = [max(x1, u1), max(y1, v1), min(x2, u2), min(y2, v2)]
(c1, d1, c2, d2) = [max(u1, a1), max(v1, b1), min(u2, a2), min(v2, b2)]
area = (x2 - x1) * (y2 - y1)
if a2 - a1 > 0 and b2 - b1 > 0:
	area -= (a2 - a1) * (b2 - b1)
if u2 - u1 > 0 and v2 - v1 > 0:
	area -= (u2 - u1) * (v2 - v1)
if c2 - c1 > 0 and d2 - d1 > 0:
	area += (c2 - c1) * (d2 - d1)
if area == 0:
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = [int(x) for x in input().split()]
(x3, y3, x4, y4) = [int(x) for x in input().split()]
(x5, y5, x6, y6) = [int(x) for x in input().split()]

def CheckPointInsideSQ(x, y, x1, y1, x2, y2):
	if x1 <= x <= x2 and y1 <= y <= y2:
		return True
	else:
		return False
Corners1 = [0] * 4
if CheckPointInsideSQ(x1, y1, x3, y3, x4, y4):
	Corners1[0] = 1
if CheckPointInsideSQ(x2, y2, x3, y3, x4, y4):
	Corners1[3] = 1
if CheckPointInsideSQ(x1, y2, x3, y3, x4, y4):
	Corners1[2] = 1
if CheckPointInsideSQ(x2, y1, x3, y3, x4, y4):
	Corners1[1] = 1
Corners2 = [0] * 4
if CheckPointInsideSQ(x1, y1, x5, y5, x6, y6):
	Corners2[0] = 1
if CheckPointInsideSQ(x2, y2, x5, y5, x6, y6):
	Corners2[3] = 1
if CheckPointInsideSQ(x1, y2, x5, y5, x6, y6):
	Corners2[2] = 1
if CheckPointInsideSQ(x2, y1, x5, y5, x6, y6):
	Corners2[1] = 1
Covered = False
if sum(Corners1) == 4 or sum(Corners2) == 4:
	Covered = True
if Corners1[0] == 1 and Corners1[2] == 1 and (Corners2[3] == 1) and (Corners2[1] == 1) and (x4 >= x5):
	Covered = True
if Corners2[0] == 1 and Corners2[2] == 1 and (Corners1[3] == 1) and (Corners1[1] == 1) and (x3 <= x6):
	Covered = True
if Corners1[0] == 1 and Corners1[1] == 1 and (Corners2[2] == 1) and (Corners2[3] == 1) and (y4 >= y5):
	Covered = True
if Corners2[0] == 1 and Corners2[1] == 1 and (Corners1[2] == 1) and (Corners1[3] == 1) and (y6 >= y3):
	Covered = True
if Covered:
	print('NO')
else:
	print('YES')


from typing import List
from math import ceil, sqrt, floor, sqrt
from collections import defaultdict, Counter, deque
from collections import defaultdict, deque
(x1, y1, x2, y2) = list(map(int, input().split()))
(x3, y3, x4, y4) = list(map(int, input().split()))
(x5, y5, x6, y6) = list(map(int, input().split()))

def cover_all(px1, px2, py1, py2, px3, px4, py3, py4):
	if px1 <= px3 <= px4 <= px2 and py1 <= py3 <= py4 <= py2:
		return True
if cover_all(x3, x4, y3, y4, x1, x2, y1, y2) or cover_all(x5, x6, y5, y6, x1, x2, y1, y2):
	print('NO')
elif x3 <= x1 <= x2 <= x4 and x5 <= x1 <= x2 <= x6 and (y3 <= y1 <= y5 <= y4 <= y2 <= y6 or y5 <= y1 <= y3 <= y6 <= y2 <= y4):
	print('NO')
elif y3 <= y1 <= y2 <= y4 and y5 <= y1 <= y2 <= y6 and (x3 <= x1 <= x5 <= x4 <= x2 <= x6 or x5 <= x1 <= x3 <= x6 <= x2 <= x4):
	print('NO')
else:
	print('YES')


def main():

	def findOverlap(r1, r2):
		(x11, y11, x21, y21) = r1
		(x12, y12, x22, y22) = r2
		xL = max(x11, x12)
		xR = min(x21, x22)
		yL = max(y11, y12)
		yR = min(y21, y22)
		if xL >= xR or yL >= yR:
			return None
		else:
			return [xL, yL, xR, yR]

	def calcArea(r):
		(x1, y1, x2, y2) = r
		return (x2 - x1) * (y2 - y1)
	rw = readIntArr()
	rb1 = readIntArr()
	rb2 = readIntArr()
	A1 = findOverlap(rw, rb1)
	A2 = findOverlap(rw, rb2)
	whiteArea = calcArea(rw)
	a1Area = a2Area = a3Area = 0
	if A1 != None:
		a1Area = calcArea(A1)
	if A2 != None:
		a2Area = calcArea(A2)
	if A1 != None and A2 != None:
		A3 = findOverlap(A1, A2)
		if A3 != None:
			a3Area = calcArea(A3)
	blackAndWhiteOverlapArea = a1Area + a2Area - a3Area
	if whiteArea > blackAndWhiteOverlapArea:
		print('YES')
	else:
		print('NO')
	return
import sys
input = sys.stdin.buffer.readline

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]

def makeArr(defaultValFactory, dimensionArr):
	dv = defaultValFactory
	da = dimensionArr
	if len(da) == 1:
		return [dv() for _ in range(da[0])]
	else:
		return [makeArr(dv, da[1:]) for _ in range(da[0])]

def queryInteractive(i, j):
	print('? {} {}'.format(i, j))
	sys.stdout.flush()
	return int(input())

def answerInteractive(ans):
	print('! {}'.format(' '.join([str(x) for x in ans])))
	sys.stdout.flush()
inf = float('inf')
MOD = 10 ** 9 + 7
for _abc in range(1):
	main()


ll = lambda : list(map(int, input().split()))
testcases = 1
for _ in range(testcases):
	[x1, y1, x2, y2] = ll()
	[x3, y3, x4, y4] = ll()
	[x5, y5, x6, y6] = ll()

	def lies1(x0, y0):
		return x0 >= x3 and x0 <= x4 and (y0 >= y3) and (y0 <= y4)

	def lies2(x0, y0):
		return x0 >= x5 and x0 <= x6 and (y0 >= y5) and (y0 <= y6)

	def lies(x0, y0):
		return lies1(x0, y0) or lies2(x0, y0)
	ap = [[x1, y1], [x2, y2], [x1, y2], [x2, y1]]
	ok = 1
	for x in ap:
		if not lies(x[0], x[1]):
			ok = 0
			break
	else:
		if x1 >= max(x3, x5) and x2 <= min(x4, x6):
			if y1 <= y6 and y6 < y3 and (y3 <= y2) or (y1 <= y4 and y4 < y5 and (y5 <= y2)):
				ok = 0
		elif x1 <= x6 and x6 < x3 and (x3 <= x2) or (x1 <= x4 and x4 < x5 and (x5 <= x2)):
			ok = 0
	if ok:
		print('NO')
	else:
		print('YES')


(x1, y1, x2, y2) = list(map(int, input().split()))
(x3, y3, x4, y4) = list(map(int, input().split()))
(x5, y5, x6, y6) = list(map(int, input().split()))
z = 0
if x3 <= x1 and x4 >= x2 and (y3 <= y1) and (y4 >= y2):
	z = 1
if x5 <= x1 and x6 >= x2 and (y5 <= y1) and (y6 >= y2):
	z = 1
if y3 > y5:
	if y3 <= y6 and y4 >= y2 and (y5 <= y1):
		if x3 <= x1 and x4 >= x2 and (x5 <= x1) and (x6 >= x2):
			z = 1
else:
	(y3, y5) = (y5, y3)
	(y6, y4) = (y4, y6)
	if y3 <= y6 and y4 >= y2 and (y5 <= y1):
		if x3 <= x1 and x4 >= x2 and (x5 <= x1) and (x6 >= x2):
			z = 1
(y3, y5) = (y5, y3)
(y6, y4) = (y4, y6)
if x3 < x5:
	if x3 <= x1 and x4 >= x5 and (x6 >= x2):
		if y3 <= y1 and y4 >= y2 and (y5 <= y1) and (y6 >= y2):
			z = 1
else:
	(x3, x5) = (x5, x3)
	(x6, x4) = (x4, x6)
	if x3 <= x1 and x4 >= x5 and (x6 >= x2):
		if y3 <= y1 and y4 >= y2 and (y5 <= y1) and (y6 >= y2):
			z = 1
if z == 1:
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = [int(x) for x in input().split()]
(x3, y3, x4, y4) = [int(x) for x in input().split()]
(x5, y5, x6, y6) = [int(x) for x in input().split()]
area = (x2 - x1) * (y2 - y1)
X1 = max(x1, x3)
X2 = min(x2, x4)
Y1 = max(y1, y3)
Y2 = min(y2, y4)
if X1 < X2 and Y1 < Y2:
	area -= (X2 - X1) * (Y2 - Y1)
X1 = max(x1, x5)
X2 = min(x2, x6)
Y1 = max(y1, y5)
Y2 = min(y2, y6)
if X1 < X2 and Y1 < Y2:
	area -= (X2 - X1) * (Y2 - Y1)
X1 = max(x5, x3)
X2 = min(x6, x4)
Y1 = max(y5, y3)
Y2 = min(y6, y4)
if X1 < X2 and Y1 < Y2:
	a = max(x1, X1)
	b = min(x2, X2)
	c = max(y1, Y1)
	d = min(y2, Y2)
	if a < b and c < d:
		area += (b - a) * (d - c)
if area > 0:
	print('YES')
else:
	print('NO')


import sys
sin = sys.stdin
w = sin.readline().split()
w = [int(x) for x in w]
b1 = sin.readline().split()
b1 = [int(x) for x in b1]
b2 = sin.readline().split()
b2 = [int(x) for x in b2]

def reduce(w, b):
	if b[0] <= w[0] and b[1] <= w[1] and (b[2] >= w[2]) and (b[3] >= w[3]):
		return True
	if b[0] <= w[0] and b[1] <= w[1]:
		if b[2] >= w[2] and b[3] >= w[1]:
			w[1] = b[3]
		if b[3] >= w[3] and b[2] >= w[0]:
			w[0] = b[2]
	elif b[2] >= w[2] and b[3] >= w[3]:
		if b[1] <= w[1] and b[0] <= w[2]:
			w[2] = b[0]
		if b[0] <= w[0] and b[1] <= w[3]:
			w[3] = b[1]
flag = False
if reduce(w, b1):
	print('NO')
	flag = True
elif not flag and reduce(w, b2):
	print('NO')
	flag = True
if not flag:
	print('YES')


def com_rect(x1, y1, x2, y2, x3, y3, x4, y4):
	l = max(min(x2, x4) - max(x3, x1), 0)
	b = max(min(y2, y4) - max(y3, y1), 0)
	if l > 0 and b > 0:
		return (max(x3, x1), max(y3, y1), min(x2, x4), min(y2, y4))
	else:
		return (0, 0, 0, 0)

def area(x1, y1, x2, y2, x3, y3, x4, y4):
	l = max(min(x2, x4) - max(x3, x1), 0)
	b = max(min(y2, y4) - max(y3, y1), 0)
	return l * b
rec1_str = input()
rec1 = rec1_str.split(' ')
x1 = int(rec1[0])
y1 = int(rec1[1])
x2 = int(rec1[2])
y2 = int(rec1[3])
rec2_str = input()
rec2 = rec2_str.split(' ')
x3 = int(rec2[0])
y3 = int(rec2[1])
x4 = int(rec2[2])
y4 = int(rec2[3])
rec3_str = input()
rec3 = rec3_str.split(' ')
x5 = int(rec3[0])
y5 = int(rec3[1])
x6 = int(rec3[2])
y6 = int(rec3[3])
com12 = area(x1, y1, x2, y2, x3, y3, x4, y4)
com123_rect = com_rect(x3, y3, x4, y4, x5, y5, x6, y6)
com123 = area(x1, y1, x2, y2, com123_rect[0], com123_rect[1], com123_rect[2], com123_rect[3])
com13 = area(x1, y1, x2, y2, x5, y5, x6, y6)
if com12 + com13 - com123 == abs((x1 - x2) * (y2 - y1)):
	print('NO')
else:
	print('YES')


def check(a, b):
	if x3 <= a <= x4 and y3 <= b <= y4 or (x5 <= a <= x6 and y5 <= b <= y6):
		return True
	else:
		return False
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if check(x1, y1) and check(x2, y2) and check(x1, y2) and check(x2, y1):
	flag1 = False
	flag2 = False
	if x3 <= x5:
		if x3 <= x1 and x4 >= x2:
			flag1 = True
		elif x5 <= x1 and x6 >= x2:
			flag1 = True
		elif x3 <= x1 and x5 <= x4 and (x2 <= x6):
			flag1 = True
	else:
		if x3 <= x1 and x4 >= x2:
			flag1 = True
		elif x5 <= x1 and x6 >= x2:
			flag1 = True
		if x5 <= x1 and x3 <= x6 and (x2 <= x4):
			flag1 = True
	if y3 <= y5:
		if y3 <= y1 and y4 >= y2:
			flag2 = True
		elif y5 <= y1 and y6 >= y2:
			flag2 = True
		elif y3 <= y1 and y5 <= y4 and (y2 <= y6):
			flag2 = True
	elif y3 <= y1 and y4 >= y2:
		flag2 = True
	elif y5 <= y1 and y6 >= y2:
		flag2 = True
	elif y5 <= y1 and y3 <= y6 and (y2 <= y4):
		flag2 = True
	if flag1 and flag2:
		print('NO')
	else:
		print('YES')
else:
	print('YES')


l = list(map(int, input().split()))
m = list(map(int, input().split()))
n = list(map(int, input().split()))
d = 0
x1 = l[0]
y1 = l[1]
x2 = l[2]
y2 = l[3]
x3 = m[0]
y3 = m[1]
x4 = m[2]
y4 = m[3]
x5 = n[0]
y5 = n[1]
x6 = n[2]
y6 = n[3]
if x5 <= x1 and y5 <= y1 and (x6 >= x2) and (y6 >= y2):
	d = 1
if x3 <= x1 and y3 <= y1 and (x4 >= x2) and (y4 >= y2):
	d = 1
if x5 <= x1 and y5 <= y1 and (x6 >= x2) and (x3 <= x1) and (y3 <= y6) and (x4 >= x2) and (y4 >= y2):
	d = 1
if x3 <= x1 and y3 <= y1 and (x4 >= x2) and (x5 <= x1) and (y5 <= y4) and (x6 >= x2) and (y6 >= y2):
	d = 1
if x5 <= x1 and y5 <= y1 and (y6 >= y2) and (x3 <= x6) and (x4 >= x2) and (y3 <= y1) and (y4 >= y2):
	d = 1
if x3 <= x1 and y3 <= y1 and (y4 >= y2) and (x5 <= x4) and (x6 >= x2) and (y5 <= y1) and (y6 >= y2):
	d = 1
if d == 1:
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if x5 <= x1 and x6 >= x2 and (y5 <= y1) and (y6 >= y2):
	print('NO')
elif x3 <= x1 and x4 >= x2 and (y4 >= y2) and (y3 <= y1):
	print('NO')
elif x5 <= x4 and x6 >= x2 and (x3 <= x1) and (y4 >= y2) and (y3 <= y1) and (y6 >= y2) and (y5 <= y1):
	print('NO')
elif y3 <= y6 and x4 >= x2 and (x3 <= x1) and (x5 <= x1) and (x6 >= x2) and (y4 >= y2) and (y1 >= y5):
	print('NO')
else:
	(tx3, tx4, tx5, tx6) = (x3, x4, x5, x6)
	(ty3, ty4, ty5, ty6) = (y3, y4, y5, y6)
	x3 = tx5
	x5 = tx3
	x4 = tx6
	x6 = tx4
	y3 = ty5
	y5 = ty3
	y4 = ty6
	y6 = ty4
	if x5 <= x1 and x6 >= x2 and (y5 <= y1) and (y6 >= y2):
		print('NO')
	elif x3 <= x1 and x4 >= x2 and (y4 >= y2) and (y3 <= y1):
		print('NO')
	elif x5 <= x4 and x6 >= x2 and (x3 <= x1) and (y4 >= y2) and (y3 <= y1) and (y6 >= y2) and (y5 <= y1):
		print('NO')
	elif y3 <= y6 and x4 >= x2 and (x3 <= x1) and (x5 <= x1) and (x6 >= x2) and (y4 >= y2) and (y1 >= y5):
		print('NO')
	else:
		print('YES')


a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
flag = 0
if b[0] <= a[0] and b[1] <= a[1] and (a[2] <= b[2]) and (a[3] <= b[3]):
	flag = 1
elif c[0] <= a[0] and c[1] <= a[1] and (a[2] <= c[2]) and (a[3] <= c[3]):
	flag = 1
elif b[0] <= a[0] and b[1] <= a[1]:
	if a[2] <= c[2] and a[3] <= c[3]:
		if a[3] <= b[3] and c[1] <= a[1] and (c[0] <= b[2]):
			flag = 1
		elif a[2] <= b[2] and c[0] <= a[0] and (c[1] <= b[3]):
			flag = 1
elif c[0] <= a[0] and c[1] <= a[1]:
	if a[2] <= b[2] and a[3] <= b[3]:
		if a[3] <= c[3] and b[1] <= a[1] and (b[0] <= c[2]):
			flag = 1
		elif a[2] <= c[2] and b[0] <= a[0] and (b[1] <= c[3]):
			flag = 1
print('YES' if flag == 0 else 'NO')


W = list(map(int, input().split()))
B1 = list(map(int, input().split()))
B2 = list(map(int, input().split()))

def intersection(A, B):
	I = [max(A[0], B[0]), max(A[1], B[1]), min(A[2], B[2]), min(A[3], B[3])]
	return I

def Area(I):
	return max(I[2] - I[0], 0) * max(I[3] - I[1], 0)
if Area(intersection(W, B1)) + Area(intersection(W, B2)) - Area(intersection(W, intersection(B2, B1))) == Area(W):
	print('NO')
else:
	print('YES')


def FindPoints(x1, y1, x2, y2, x3, y3, x4, y4):
	x5 = max(x1, x3)
	y5 = max(y1, y3)
	x6 = min(x2, x4)
	y6 = min(y2, y4)
	if x5 > x6 or y5 > y6:
		return [(0, 0), (0, 0)]
	return [[x5, y5], [x6, y6]]
(a, b, c, d) = map(int, input().split())
(a1, b1, c1, d1) = map(int, input().split())
(a2, b2, c2, d2) = map(int, input().split())
e = FindPoints(a, b, c, d, a1, b1, c1, d1)
rt = abs(e[0][0] - e[1][0]) * abs(e[0][1] - e[1][1])
ans = rt
e1 = FindPoints(a, b, c, d, a2, b2, c2, d2)
rt = abs(e1[0][0] - e1[1][0]) * abs(e1[0][1] - e1[1][1])
ans += rt
e = FindPoints(e[0][0], e[0][1], e[1][0], e[1][1], e1[0][0], e1[0][1], e1[1][0], e1[1][1])
rt = abs(e[0][0] - e[1][0]) * abs(e[0][1] - e[1][1])
ans -= rt
tot = abs(a - c) * abs(b - d)
if tot > ans:
	print('YES')
else:
	print('NO')


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))

def in_rect(x, y, r):
	(x1, y1, x2, y2) = r
	return x1 <= x <= x2 and y1 <= y <= y2
w = rints()
b1 = rints()
b2 = rints()
xvals = sorted([w[0], w[2], b1[0], b1[2], b2[0], b2[2]])
yvals = sorted([w[1], w[3], b1[1], b1[3], b2[1], b2[3]])
for x in xvals:
	for y in yvals:
		if in_rect(x + 0.5, y + 0.5, w) and (not in_rect(x + 0.5, y + 0.5, b1)) and (not in_rect(x + 0.5, y + 0.5, b2)):
			print('YES')
			exit(0)
print('NO')


def intersection(a, b):
	return (max(a[0], b[0]), max(a[1], b[1]), min(a[2], b[2]), min(a[3], b[3]))

def area(lst):
	return max(lst[2] - lst[0], 0) * max(lst[3] - lst[1], 0)
w = [int(i) for i in input().split()]
lst1 = [int(i) for i in input().split()]
lst2 = [int(i) for i in input().split()]
if area(intersection(w, lst1)) + area(intersection(w, lst2)) - area(intersection(w, intersection(lst1, lst2))) == area(w):
	print('NO')
else:
	print('YES')


(Wx1, Wy1, Wx2, Wy2) = map(int, input().split())
(B1x1, B1y1, B1x2, B1y2) = map(int, input().split())
(B2x1, B2y1, B2x2, B2y2) = map(int, input().split())
s1 = [Wx1, Wx2]
s3 = [Wx1, Wx2]
s2 = [Wy1, Wy2]
s4 = [Wy1, Wy2]
B1s1 = [0, 0]
B2s1 = [0, 0]
B1s2 = [0, 0]
B2s2 = [0, 0]
B1s3 = [0, 0]
B2s3 = [0, 0]
B1s4 = [0, 0]
B2s4 = [0, 0]
if B1y1 <= Wy1 and B1y2 >= Wy1:
	B1s1 = [B1x1, B1x2]
if B2y1 <= Wy1 and B2y2 >= Wy1:
	B2s1 = [B2x1, B2x2]
if B1x1 <= Wx2 and B1x2 >= Wx2:
	B1s2 = [B1y1, B1y2]
if B2x1 <= Wx2 and B2x2 >= Wx2:
	B2s2 = [B2y1, B2y2]
if B1y1 <= Wy2 and B1y2 >= Wy2:
	B1s3 = [B1x1, B1x2]
if B2y1 <= Wy2 and B2y2 >= Wy2:
	B2s3 = [B2x1, B2x2]
if B1x1 <= Wx1 and B1x2 >= Wx1:
	B1s4 = [B1y1, B1y2]
if B2x1 <= Wx1 and B2x2 >= Wx1:
	B2s4 = [B2y1, B2y2]
if B1s1[0] <= s1[0]:
	s1[0] = max(s1[0], B1s1[1])
if B1s1[1] >= s1[1]:
	s1[1] = min(s1[1], B1s1[0])
if B2s1[0] <= s1[0]:
	s1[0] = max(s1[0], B2s1[1])
if B2s1[1] >= s1[1]:
	s1[1] = min(s1[1], B2s1[0])
if B1s2[0] <= s2[0]:
	s2[0] = max(s2[0], B1s2[1])
if B1s2[1] >= s2[1]:
	s2[1] = min(s2[1], B1s2[0])
if B2s2[0] <= s2[0]:
	s2[0] = max(s2[0], B2s2[1])
if B2s2[1] >= s2[1]:
	s2[1] = min(s2[1], B2s2[0])
if B1s3[0] <= s3[0]:
	s3[0] = max(s3[0], B1s3[1])
if B1s3[1] >= s3[1]:
	s3[1] = min(s3[1], B1s3[0])
if B2s3[0] <= s3[0]:
	s3[0] = max(s3[0], B2s3[1])
if B2s3[1] >= s3[1]:
	s3[1] = min(s3[1], B2s3[0])
if B1s4[0] <= s4[0]:
	s4[0] = max(s4[0], B1s4[1])
if B1s4[1] >= s4[1]:
	s4[1] = min(s4[1], B1s4[0])
if B2s4[0] <= s4[0]:
	s4[0] = max(s4[0], B2s4[1])
if B2s4[1] >= s4[1]:
	s4[1] = min(s4[1], B2s4[0])
if s1[0] >= s1[1] and s2[0] >= s2[1] and (s3[0] >= s3[1]) and (s4[0] >= s4[1]):
	print('NO')
else:
	print('YES')


import sys, math, itertools
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush, heapify, nlargest
from copy import deepcopy
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))

def inpl_1():
	return list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))

def inps():
	return sys.stdin.readline()

def inpsl(x):
	tmp = sys.stdin.readline()
	return list(tmp[:x])

def err(x):
	print(x)
	exit()
(x1, y1, x2, y2) = inpl()
(x3, y3, x4, y4) = inpl()
(x5, y5, x6, y6) = inpl()
a = [[] for _ in range(10 ** 6)]
for i in range(x1, x2):
	a[i].append((y1, y2))
for (x3, y3, x4, y4) in [(x3, y3, x4, y4), (x5, y5, x6, y6)]:
	for i in range(x3, x4):
		if not a[i]:
			continue
		app = []
		for (ya, yb) in a[i]:
			if y3 <= ya and yb <= y4:
				ya = -1
			elif y4 <= ya or y3 >= yb:
				pass
			elif y3 <= ya:
				ya = y4
			elif yb <= y4:
				yb = y3
			else:
				ya = -1
				app.append((ya, y3))
				app.append((y4, yb))
			if ya >= 0:
				app.append((ya, yb))
		a[i] = []
		for x in app:
			a[i].append(x)
for i in range(10 ** 6):
	if a[i]:
		print('YES')
		break
else:
	print('NO')


def area(xmin, ymin, xmax, ymax):
	dx = xmax - xmin
	dy = ymax - ymin
	if dx >= 0 and dy >= 0:
		return dx * dy
	else:
		return 0

def intersect(a_xmin, a_ymin, a_xmax, a_ymax, b_xmin, b_ymin, b_xmax, b_ymax):
	(xmax, xmin) = (min(a_xmax, b_xmax), max(a_xmin, b_xmin))
	(ymax, ymin) = (min(a_ymax, b_ymax), max(a_ymin, b_ymin))
	return (xmin, ymin, xmax, ymax)
(a_xmin, a_ymin, a_xmax, a_ymax) = list(map(int, input().split()))
(b_xmin, b_ymin, b_xmax, b_ymax) = list(map(int, input().split()))
(c_xmin, c_ymin, c_xmax, c_ymax) = list(map(int, input().split()))
s1 = (a_xmax - a_xmin) * (a_ymax - a_ymin)
(s12_xmin, s12_ymin, s12_xmax, s12_ymax) = intersect(a_xmin, a_ymin, a_xmax, a_ymax, b_xmin, b_ymin, b_xmax, b_ymax)
s12 = area(s12_xmin, s12_ymin, s12_xmax, s12_ymax)
(s13_xmin, s13_ymin, s13_xmax, s13_ymax) = intersect(a_xmin, a_ymin, a_xmax, a_ymax, c_xmin, c_ymin, c_xmax, c_ymax)
s13 = area(s13_xmin, s13_ymin, s13_xmax, s13_ymax)
(s23_xmin, s23_ymin, s23_xmax, s23_ymax) = intersect(b_xmin, b_ymin, b_xmax, b_ymax, c_xmin, c_ymin, c_xmax, c_ymax)
s23 = area(s23_xmin, s23_ymin, s23_xmax, s23_ymax)
(s123_xmin, s123_ymin, s123_xmax, s123_ymax) = intersect(s13_xmin, s13_ymin, s13_xmax, s13_ymax, s23_xmin, s23_ymin, s23_xmax, s23_ymax)
s123 = area(s123_xmin, s123_ymin, s123_xmax, s123_ymax)
print('YES' if s1 > s12 + s13 - s123 else 'NO')


from sys import stdin
input = stdin.readline
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
if y4 >= y2 and y3 <= y1 and (x4 >= x2) and (x3 <= x1):
	print('NO')
	exit()
if y6 >= y2 and y5 <= y1 and (x6 >= x2) and (x5 <= x1):
	print('NO')
	exit()
if x4 >= x2 and x6 >= x2 and (x3 <= x1) and (x5 <= x1) and (y6 >= y2 and y3 <= y1 and (y4 >= y5) or (y4 >= y2 and y5 <= y1 and (y6 >= y3))):
	print('NO')
	exit()
if y4 >= y2 and y6 >= y2 and (y3 <= y1) and (y5 <= y1) and (x6 >= x2 and x3 <= x1 and (x4 >= x5) or (x4 >= x2 and x5 <= x1 and (x6 >= x3))):
	print('NO')
	exit()
print('YES')


inputs = input().split(' ')
b1 = []
b1.append(int(inputs[0]))
b1.append(int(inputs[1]))
b1.append(int(inputs[2]))
b1.append(int(inputs[3]))
inputs = input().split(' ')
b2 = []
b2.append(int(inputs[0]))
b2.append(int(inputs[1]))
b2.append(int(inputs[2]))
b2.append(int(inputs[3]))
inputs = input().split(' ')
b3 = []
b3.append(int(inputs[0]))
b3.append(int(inputs[1]))
b3.append(int(inputs[2]))
b3.append(int(inputs[3]))

def inside(x1, y1, blackBoard):
	if x1 >= blackBoard[0] and x1 <= blackBoard[2] and (y1 >= blackBoard[1]) and (y1 <= blackBoard[3]):
		return 1
	return 0
cornersInside = inside(b1[0], b1[1], b2) + inside(b1[2], b1[3], b2) + inside(b1[0], b1[3], b2) + inside(b1[2], b1[1], b2)

def printFunc():
	if inside(b1[0], b1[1], b3) + inside(b1[2], b1[3], b3) + inside(b1[0], b1[3], b3) + inside(b1[2], b1[1], b3) == 4:
		print('No')
	else:
		print('YES')
if cornersInside == 1 or cornersInside == 0:
	printFunc()
elif cornersInside == 4:
	print('NO')
elif inside(b1[0], b1[1], b2) and inside(b1[0], b1[3], b2):
	b1[0] = b2[2]
	printFunc()
elif inside(b1[2], b1[3], b2) and inside(b1[0], b1[3], b2):
	b1[3] = b2[1]
	printFunc()
elif inside(b1[0], b1[1], b2) and inside(b1[2], b1[1], b2):
	b1[1] = b2[3]
	printFunc()
else:
	b1[2] = b2[0]
	printFunc()


(wx1, wy1, wx2, wy2) = (int(i) for i in input().split())
(b1x1, b1y1, b1x2, b1y2) = (int(i) for i in input().split())
(b2x1, b2y1, b2x2, b2y2) = (int(i) for i in input().split())

def dot_in_square(dx, dy, sx1, sy1, sx2, sy2):
	if dx >= min(sx1, sx2) and dx <= max(sx1, sx2):
		if dy >= min(sy1, sy2) and dy <= max(sy1, sy2):
			return 1
	return 0

def dots_in_square(dots, square):
	for dot in dots:
		if not dot_in_square(dot[0], dot[1], square[0], square[1], square[2], square[3]):
			return 0
	return 1
square1 = [b1x1, b1y1, b1x2, b1y2]
square2 = [b2x1, b2y1, b2x2, b2y2]
dot1 = [wx1, wy1]
dot2 = [wx1, wy2]
dot3 = [wx2, wy1]
dot4 = [wx2, wy2]
all_dots = [dot1, dot2, dot3, dot4]
if dots_in_square(all_dots, square1) or dots_in_square(all_dots, square2):
	print('NO')
else:
	if dots_in_square([dot1, dot2], square1):
		dot1[0] = max(square1[0], square1[2])
		dot2[0] = max(square1[0], square1[2])
	elif dots_in_square([dot1, dot2], square2):
		dot1[0] = max(square2[0], square2[2])
		dot2[0] = max(square2[0], square2[2])
	elif dots_in_square([dot3, dot4], square1):
		dot3[0] = min(square1[0], square1[2])
		dot4[0] = min(square1[0], square1[2])
	elif dots_in_square([dot3, dot4], square2):
		dot3[0] = min(square2[0], square2[2])
		dot4[0] = min(square2[0], square2[2])
	if dots_in_square([dot1, dot3], square1):
		dot1[1] = max(square1[1], square1[3])
		dot3[1] = max(square1[1], square1[3])
	elif dots_in_square([dot1, dot3], square2):
		dot1[1] = max(square2[1], square2[3])
		dot3[1] = max(square2[1], square2[3])
	elif dots_in_square([dot2, dot4], square1):
		dot2[1] = min(square1[1], square1[3])
		dot4[1] = min(square1[1], square1[3])
	elif dots_in_square([dot2, dot4], square2):
		dot2[1] = min(square2[1], square2[3])
		dot4[1] = min(square2[1], square2[3])
	if dots_in_square(all_dots, square1) or dots_in_square(all_dots, square2):
		print('NO')
	else:
		print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
for x in range(x1 * 2, x2 * 2 + 1):
	x /= 2
	p1 = (x, y1)
	p2 = (x, y2)
	for (x7, y7) in [p1, p2]:
		if x3 <= x7 <= x4 and y3 <= y7 <= y4 or (x5 <= x7 <= x6 and y5 <= y7 <= y6):
			pass
		else:
			print('YES')
			exit(0)
for y in range(y1 * 2, y2 * 2 + 1):
	y /= 2
	p1 = (x1, y)
	p2 = (x2, y)
	for (x7, y7) in [p1, p2]:
		if x3 <= x7 <= x4 and y3 <= y7 <= y4 or (x5 <= x7 <= x6 and y5 <= y7 <= y6):
			pass
		else:
			print('YES')
			exit(0)
print('NO')


(x1, y1, x2, y2) = list(map(int, input().split()))
(x3, y3, x4, y4) = list(map(int, input().split()))
(x5, y5, x6, y6) = list(map(int, input().split()))

def check(x, y):
	return not (x >= x3 and x <= x4 and (y >= y3) and (y <= y4) or (x >= x5 and x <= x6 and (y >= y5) and (y <= y6)))
flag = False
diff = 2 * (x2 - x1 + 1)
for i in range(diff - 1):
	flag = flag or check(x1 + 0.5 * i, y1)
diff = 2 * (x2 - x1 + 1)
for i in range(diff - 1):
	flag = flag or check(x1 + 0.5 * i, y2)
diff = 2 * (y2 - y1 + 1)
for i in range(diff - 1):
	flag = flag or check(x1, i * 0.5 + y1)
diff = 2 * (y2 - y1 + 1)
for i in range(diff - 1):
	flag = flag or check(x2, i * 0.5 + y1)
if flag == False:
	print('NO')
else:
	print('YES')


(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())

def check_rect1(x, y):
	if x3 <= x <= x4 and y3 <= y <= y4:
		return True
	else:
		return False

def check_rect2(x, y):
	if x5 <= x <= x6 and y5 <= y <= y6:
		return True
	else:
		return False
if not (check_rect1(x1, y1) or check_rect2(x1, y1)):
	print('YES')
elif not (check_rect1(x2, y1) or check_rect2(x2, y1)):
	print('YES')
elif not (check_rect1(x2, y2) or check_rect2(x2, y2)):
	print('YES')
elif not (check_rect1(x1, y2) or check_rect2(x1, y2)):
	print('YES')
elif check_rect2(x1, y1) and check_rect2(x2, y1) and check_rect1(x1, y2) and check_rect1(x2, y2):
	if y6 < y3:
		print('YES')
	else:
		print('NO')
elif check_rect1(x1, y1) and check_rect1(x2, y1) and check_rect2(x1, y2) and check_rect2(x2, y2):
	if y4 < y5:
		print('YES')
	else:
		print('NO')
elif check_rect1(x1, y1) and check_rect2(x2, y1) and check_rect1(x1, y2) and check_rect2(x2, y2):
	if x4 < x5:
		print('YES')
	else:
		print('NO')
elif check_rect2(x1, y1) and check_rect1(x2, y1) and check_rect2(x1, y2) and check_rect1(x2, y2):
	if x6 < x3:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


def f():
	(w_x1, w_y1, w_x2, w_y2) = [int(i) for i in str.split(input(), ' ')]
	for i in range(2):
		(b_x1, b_y1, b_x2, b_y2) = [int(i) for i in str.split(input(), ' ')]
		if b_y1 <= w_y1 and b_y2 >= w_y2:
			if b_x1 <= w_x1 and b_x2 >= w_x1:
				if b_x2 >= w_x2:
					print('NO')
					return
				else:
					w_x1 = b_x2
			elif b_x1 >= w_x1 and b_x1 <= w_x2:
				if b_x2 >= w_x2:
					w_x2 = b_x1
		if b_x1 <= w_x1 and b_x2 >= w_x2:
			if b_y1 <= w_y1 and b_y2 >= w_y1:
				if b_y2 >= w_y2:
					print('NO')
					return
				else:
					w_y1 = b_y2
			elif b_y1 >= w_y1 and b_y1 <= w_y2:
				if b_y2 >= w_y2:
					w_y2 = b_y1
	print('YES')
f()


def inside(a, b):
	return b[0] <= a[0] and b[1] <= a[1] and (b[2] >= a[2]) and (b[3] >= a[3])
d1 = list(map(int, input().split()))
d2 = list(map(int, input().split()))
d3 = list(map(int, input().split()))
if inside(d1, d2):
	print('NO')
elif inside(d1, d3):
	print('NO')
else:
	flag = False
	for x in range(d1[0], d1[2]):
		d4 = d1[:]
		d4[2] = x
		d5 = d1[:]
		d5[0] = x
		if inside(d4, d2) and inside(d5, d3):
			print('NO')
			flag = True
		elif inside(d4, d3) and inside(d5, d2):
			print('NO')
			flag = True
		if flag:
			break
	if flag == False:
		for y in range(d1[1], d1[3]):
			d4 = d1[:]
			d4[3] = y
			d5 = d1[:]
			d5[1] = y
			if inside(d4, d2) and inside(d5, d3):
				print('NO')
				flag = True
			elif inside(d4, d3) and inside(d5, d2):
				print('NO')
				flag = True
			if flag:
				break
	if flag == False:
		print('YES')


def fun(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6):
	if y3 <= y1 and y4 >= y2 and (x3 <= x1) and (x5 <= x4) and (y5 <= y1) and (y6 >= y2) and (x6 >= x2) and (x4 < x2):
		return True
	return False

def fun2(x1, y1, x2, y2, x3, y3, x4, y4):
	if x3 <= x1 and x4 >= x2 and (y4 >= y2) and (y3 <= y1):
		return True
	return False

def fun3(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6):
	if x3 <= x1 and x4 >= x2 and (x5 <= x1) and (x6 >= x2) and (y4 >= y2) and (y6 >= y3) and (y5 <= y1) and (y3 > y1):
		return True
	return False
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
ok = False
if fun2(x1, y1, x2, y2, x3, y3, x4, y4):
	ok = True
if fun2(x1, y1, x2, y2, x5, y5, x6, y6):
	ok = True
if fun(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6):
	ok = True
if fun(x1, y1, x2, y2, x5, y5, x6, y6, x3, y3, x4, y4):
	ok = True
if fun3(x1, y1, x2, y2, x5, y5, x6, y6, x3, y3, x4, y4):
	ok = True
if fun3(x1, y1, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6):
	ok = True
if ok:
	print('NO')
else:
	print('YES')


A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
if B[0] <= A[0] and B[1] <= A[1] and (B[2] >= A[2]) and (B[3] >= A[3]):
	print('NO')
elif C[0] <= A[0] and C[1] <= A[1] and (C[2] >= A[2]) and (C[3] >= A[3]):
	print('NO')
elif B[3] >= A[3] and B[2] >= A[2]:
	if B[0] < A[2] and B[0] > A[0] and (B[1] <= A[1]) and (C[0] <= A[0]) and (C[1] <= A[1]) and (C[2] >= B[0]) and (C[3] >= A[3]):
		print('NO')
	elif B[0] <= A[0] and B[1] > A[1] and (B[1] < A[3]) and (C[0] <= A[0]) and (C[1] <= A[1]) and (C[2] >= A[2]) and (C[3] >= B[1]):
		print('NO')
	else:
		print('YES')
elif B[0] <= A[0] and B[1] <= A[1] and (B[2] < A[2]) and (B[2] > A[0]) and (B[3] >= A[3]) and (C[2] >= A[2]) and (C[3] >= A[3]) and (C[0] <= B[2]) and (C[1] <= A[1]):
	print('NO')
elif B[0] <= A[0] and B[1] <= A[1] and (B[2] >= A[2]) and (B[3] > A[1]) and (B[3] < A[3]) and (C[0] <= A[0]) and (C[1] <= B[3]) and (C[2] >= A[2]) and (C[3] >= A[3]):
	print('NO')
else:
	print('YES')


import sys
from collections import defaultdict as dd
from itertools import permutations as pp
from itertools import combinations as cc
from collections import Counter as ccd
from random import randint as rd
from bisect import bisect_left as bl
from heapq import heappush as hpush
from heapq import heappop as hpop
mod = 10 ** 9 + 7

def ri(flag=0):
	if flag == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
from collections import namedtuple
Rectangle = namedtuple('Rectangle', 'xmin ymin xmax ymax')
ra = Rectangle(3.0, 3.0, 5.0, 5.0)
rb = Rectangle(1.0, 1.0, 4.0, 3.5)

def area(a, b):
	dx = min(a.xmax, b.xmax) - max(a.xmin, b.xmin)
	dy = min(a.ymax, b.ymax) - max(a.ymin, b.ymin)
	if dx >= 0 and dy >= 0:
		return dx * dy
	else:
		return 0

def take(a, b):
	dxmax = min(a.xmax, b.xmax)
	dxmin = max(a.xmin, b.xmin)
	dymax = min(a.ymax, b.ymax)
	dymin = max(a.ymin, b.ymin)
	return Rectangle(dxmin, dymin, dxmax, dymax)
a = ri()
a = Rectangle(a[0], a[1], a[2], a[3])
b = ri()
b = Rectangle(b[0], b[1], b[2], b[3])
c = ri()
c = Rectangle(c[0], c[1], c[2], c[3])
first = area(a, b)
two = area(a, c)
hey1 = take(a, b)
hey2 = take(a, c)
three = area(hey1, hey2)
if abs(a[0] - a[2]) * abs(a[1] - a[3]) - first - two + three > 0:
	print('YES')
else:
	print('NO')


import io
import os
import collections
import math
import functools
import itertools
import bisect
import heapq
from sys import stdin, stdout, stderr
from collections import *
from math import *
from functools import *
from itertools import *
from heapq import *
from bisect import bisect_left, bisect_right, insort_left, insort_right
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def get_ints():
	return list(map(int, input().split()))

def get_int():
	return int(input())

def get_str():
	return ''.join(list(map(chr, input()))[:-1])

def eprint(*args):
	stderr.write(', '.join(map(str, args)) + '\n')

def print(*args):
	stdout.write(' '.join(map(str, args)) + '\n')
(x1, y1, x2, y2) = get_ints()
(x3, y3, x4, y4) = get_ints()
(x5, y5, x6, y6) = get_ints()

def is_good():
	if x3 <= x1 and y3 <= y1 and (x4 >= x2) and (y4 >= y2):
		return False
	if x5 <= x1 and y5 <= y1 and (x6 >= x2) and (y6 >= y2):
		return False
	if y4 >= y2 and x3 <= x1 and (x4 >= x2) and (y3 < y2):
		if y5 <= y1 and x5 <= x1 and (x6 >= x2) and (y6 >= y3):
			return False
	if y6 >= y2 and x5 <= x1 and (x6 >= x2) and (y5 < y2):
		if y3 <= y1 and x3 <= x1 and (x4 >= x2) and (y4 >= y5):
			return False
	if x3 <= x1 and y3 <= y1 and (y4 >= y2) and (x4 > x1):
		if x6 >= x2 and y5 <= y1 and (y6 >= y2) and (x5 <= x4):
			return False
	if x5 <= x1 and y5 <= y1 and (y6 >= y2) and (x6 > x1):
		if x4 >= x2 and y3 <= y1 and (y4 >= y2) and (x3 <= x6):
			return False
	return True
print('YES' if is_good() else 'NO')


def overlap():
	(ax1, ay1) = (x3, y4)
	(ax2, ay2) = (x4, y3)
	(bx1, by1) = (x5, y6)
	(bx2, by2) = (x6, y5)
	return ax1 <= bx2 and ax2 >= bx1 and (ay1 >= by2) and (ay2 <= by1)

def full_cover(xb, yb, xt, yt):
	return xb <= x1 and yb <= y1 and (xt >= x2) and (yt >= y2)

def f1(x, y):
	return x <= x1 and y <= y1

def f2(x, y):
	return x <= x1 and y >= y2

def f3(x, y):
	return x >= x2 and y >= y2

def f4(x, y):
	return x >= x2 and y <= y1
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
edges = (((x1, y1), (x2, y2), (x1, y2), (x2, y1)), ((x3, y3), (x4, y4), (x3, y4), (x4, y3)), ((x5, y5), (x6, y6), (x5, y6), (x6, y5)))
if full_cover(x3, y3, x4, y4) or full_cover(x5, y5, x6, y6):
	print('NO')
	exit()
if (f1(x3, y3) or f1(x5, y5)) and (f2(x3, y4) or f2(x5, y6)) and (f3(x4, y4) or f3(x6, y6)) and (f4(x4, y3) or f4(x6, y5)):
	if overlap():
		print('NO')
	else:
		print('YES')
else:
	print('YES')


def fun(x, y, w, e):
	if w[0] <= x <= w[2] and w[1] <= y <= w[3] or (e[0] <= x <= e[2] and e[1] <= y <= e[3]):
		return 1
	else:
		return 0
q = [int(x) for x in input().split()]
w = [int(x) for x in input().split()]
e = [int(x) for x in input().split()]
if q[0] >= w[0] and q[1] >= w[1] and (q[2] <= w[2]) and (q[3] <= w[3]) or (q[0] >= e[0] and q[1] >= e[1] and (q[2] <= e[2]) and (q[3] <= e[3])):
	print('NO')
elif fun(q[0], q[1], w, e) and fun(q[2], q[3], w, e) and fun(q[0], q[3], w, e) and fun(q[2], q[1], w, e):
	if w[2] >= e[0] and e[2] >= w[0] and (w[3] >= e[1]) and (e[3] >= w[1]):
		print('NO')
	else:
		print('YES')
else:
	print('YES')


def intersect_area(x1, y1, x2, y2, x3, y3, x4, y4):
	x_overlap1 = min(x2, x4) - max(x1, x3)
	y_overlap1 = min(y2, y4) - max(y1, y3)
	if x_overlap1 > 0 and y_overlap1 > 0:
		return x_overlap1 * y_overlap1
	return 0
(x1, y1, x2, y2) = map(int, input().split())
(x3, y3, x4, y4) = map(int, input().split())
(x5, y5, x6, y6) = map(int, input().split())
a = intersect_area(x1, y1, x2, y2, x3, y3, x4, y4)
b = intersect_area(x1, y1, x2, y2, x5, y5, x6, y6)
c = intersect_area(x1, y1, x2, y2, max(x3, x5), max(y3, y5), min(x4, x6), min(y4, y6))
area = (x2 - x1) * (y2 - y1)
if area - (a + b - c) > 0:
	print('YES')
else:
	print('NO')


w = list(map(int, input().split()))
b1 = list(map(int, input().split()))
b2 = list(map(int, input().split()))
if b1[0] <= w[0] and b1[1] <= w[1] and (b1[2] >= w[2]) and (b1[3] >= w[3]):
	print('NO')
elif b2[0] <= w[0] and b2[1] <= w[1] and (b2[2] >= w[2]) and (b2[3] >= w[3]):
	print('NO')
elif b1[0] <= w[0] and b1[1] <= w[1]:
	if b2[2] >= w[2] and b2[3] >= w[3]:
		if b1[2] >= w[2] and b2[0] <= w[0] and (b1[3] >= b2[1]):
			print('NO')
		elif b1[3] >= w[3] and b2[1] <= w[1] and (b1[2] >= b2[0]):
			print('NO')
		else:
			print('YES')
	else:
		print('YES')
elif b2[0] <= w[0] and b2[1] <= w[1]:
	if b1[2] >= w[2] and b1[3] >= w[3]:
		if b2[2] >= w[2] and b1[0] <= w[0] and (b2[3] >= b1[1]):
			print('NO')
		elif b2[3] >= w[3] and b1[1] <= w[1] and (b2[2] >= b1[0]):
			print('NO')
		else:
			print('YES')
	else:
		print('YES')
else:
	print('YES')


w = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))

def cover(w, b):
	return b[0] <= w[0] and w[2] <= b[2] and (b[1] <= w[1]) and (w[3] <= b[3])

def hcover(w, b1, b2):
	h = b1[0] <= w[0] and w[2] <= b1[2] and (b2[0] <= w[0]) and (w[2] <= b2[2])
	v1 = b1[1] <= w[1] and b2[1] <= b1[3] and (w[3] <= b2[3])
	v2 = b2[1] <= w[1] and b1[1] <= b2[3] and (w[3] <= b1[3])
	return h and (v1 or v2)

def vcover(w, b1, b2):
	h = b1[1] <= w[1] and w[3] <= b1[3] and (b2[1] <= w[1]) and (w[3] <= b2[3])
	v1 = b1[0] <= w[0] and b2[0] <= b1[2] and (w[2] <= b2[2])
	v2 = b2[0] <= w[0] and b1[0] <= b2[2] and (w[2] <= b1[2])
	return h and (v1 or v2)
if cover(w, b) or cover(w, g) or hcover(w, b, g) or vcover(w, b, g):
	print('NO')
else:
	print('YES')


w = [int(x) for x in input().split(' ')]
b = [[int(x) for x in input().split(' ')], [int(x) for x in input().split(' ')]]
r = [0, 0, 0, 0]
rot = []
res = True
for i in b:
	t = 0
	if i[2] >= w[0] >= i[0] and i[1] <= w[1] <= i[3]:
		r[0] = 1
		t += 1
	if i[2] >= w[0] >= i[0] and i[1] <= w[3] <= i[3]:
		r[1] = 1
		t += 2
	if i[2] >= w[2] >= i[0] and i[1] <= w[3] <= i[3]:
		r[2] = 1
		t += 4
	if i[2] >= w[2] >= i[0] and i[1] <= w[1] <= i[3]:
		r[3] = 1
		t += 8
	if t == 3:
		rot.append('left ver')
	elif t == 12:
		rot.append('right ver')
	elif t == 6:
		rot.append('top hor')
	elif t == 9:
		rot.append('bot hor')
	elif t in [7, 11, 13, 14, 15]:
		rot.append('cover')
if r[0] and r[1] and r[2] and r[3]:
	if 'cover' in rot:
		res = False
	else:
		if 'ver' in rot[0] and 'ver' in rot[1]:
			if 'left' in rot[0] and b[1][0] - b[0][2] <= 0:
				res = False
			if 'right' in rot[0] and b[0][0] - b[1][2] <= 0:
				res = False
		if 'hor' in rot[0] and 'hor' in rot[1]:
			if 'top' in rot[0] and b[0][1] - b[1][3] <= 0:
				res = False
			if 'bot' in rot[0] and b[1][1] - b[0][3] <= 0:
				res = False
if res:
	print('YES')
else:
	print('NO')


from sys import stdin

def arr_inp(n):
	if n == 1:
		return [int(x) for x in stdin.readline().split()]
	elif n == 2:
		return [float(x) for x in stdin.readline().split()]
	else:
		return list(stdin.readline()[:-1])
(w, b1, b2) = [arr_inp(1) for i in range(3)]
coun = 0
for i in range(w[0], w[2]):
	for j in [w[1], w[3]]:
		if i + 0.5 >= b1[0] and i + 0.5 <= b1[2] and (j >= b1[1]) and (j <= b1[3]):
			coun += 1
		elif i + 0.5 >= b2[0] and i + 0.5 <= b2[2] and (j >= b2[1]) and (j <= b2[3]):
			coun += 1
for i in range(w[1], w[3]):
	for j in [w[0], w[2]]:
		if i + 0.5 >= b1[1] and i + 0.5 <= b1[3] and (j >= b1[0]) and (j <= b1[2]):
			coun += 1
		elif i + 0.5 >= b2[1] and i + 0.5 <= b2[3] and (j >= b2[0]) and (j <= b2[2]):
			coun += 1
s = (w[2] - w[0] + (w[3] - w[1])) * 2
print('NO' if coun == s else 'YES')


from math import floor, sqrt

def readints():
	return list(map(int, input().split(' ')))

def area(rectangle):
	return abs(rectangle[0] - rectangle[2]) * abs(rectangle[1] - rectangle[3])

def intersection(A, B):
	if not A or not B:
		return False
	X_inter_1 = max(A[0], B[0])
	X_inter_2 = min(A[2], B[2])
	Y_inter_1 = max(A[1], B[1])
	Y_inter_2 = min(A[3], B[3])
	if X_inter_2 < X_inter_1 or Y_inter_2 < Y_inter_1:
		return False
	else:
		return [X_inter_1, Y_inter_1, X_inter_2, Y_inter_2]
whitesheet = readints()
first = readints()
second = readints()
intersection_1 = intersection(first, whitesheet)
intersection_2 = intersection(second, whitesheet)
intersection_commune = intersection(intersection_1, intersection_2)
aux = 0
if intersection_1:
	aux += area(intersection_1)
if intersection_2:
	aux += area(intersection_2)
if intersection_commune:
	aux -= area(intersection_commune)
bool = area(whitesheet) > aux
if bool:
	print('YES')
else:
	print('NO')


from typing import NamedTuple
import itertools as it
try:
	from string_source import string_source
	source = string_source('3 3 7 5\n0 0 4 6\n0 0 7 4')
	source = string_source('2 2 4 4\n1 1 3 5\n3 1 5 5')
except ImportError:
	source = input

class Rectangle(NamedTuple):
	bx: int
	by: int
	tx: int
	ty: int

	def contain_point(self, x, y):
		return self.bx <= x <= self.tx and self.by <= y <= self.ty

	def corners(self):
		return list(it.product([self.bx, self.tx], [self.by, self.ty]))

	def overlaps(self, other):
		return self.by >= other.ty or other.by

	@staticmethod
	def parse(s):
		return Rectangle(*map(int, s.split()))

def is_seen(white: Rectangle, black1: Rectangle, black2: Rectangle):
	b1 = []
	b2 = []
	for (idx, (cx, cy)) in enumerate(white.corners()):
		if black1.contain_point(cx, cy):
			b1.append(idx)
		if black2.contain_point(cx, cy):
			b2.append(idx)
	if len(b1) == 4 or len(b2) == 4:
		return False
	if len(set(b1 + b2)) == 4:
		is_overlap = any((black1.contain_point(*p) for p in black2.corners())) or any((black2.contain_point(*p) for p in black1.corners()))
		return not is_overlap
	return True
assert is_seen(*map(Rectangle.parse, '5 2 10 5\n3 1 7 6\n8 1 11 7'.split('\n')))
assert is_seen(*map(Rectangle.parse, '0 0 1000000 1000000\n0 0 499999 1000000\n500000 0 1000000 1000000'.split('\n')))
assert not is_seen(*map(Rectangle.parse, '2 2 4 4\n1 1 3 5\n3 1 5 5'.split('\n')))
assert is_seen(*map(Rectangle.parse, '3 3 7 5\n0 0 4 6\n0 0 7 4'.split('\n')))
white = Rectangle.parse(source())
black1 = Rectangle.parse(source())
black2 = Rectangle.parse(source())
if is_seen(white, black1, black2):
	print('YES')
else:
	print('NO')


def main():
	w = readIntArr()
	b1 = readIntArr()
	b2 = readIntArr()

	def notInRect(r, x, y):
		(x1, y1, x2, y2) = r
		inRect = x1 <= x <= x2 and y1 <= y <= y2
		return not inRect

	def inLineButNotInRects(x1, y1, x2, y2):
		toRound = False
		x = x1
		y = y1
		res = False
		if x1 == x2:
			while y <= y2:
				if notInRect(b1, x, y) and notInRect(b2, x, y):
					res = True
					break
				y += 0.5
				if toRound:
					y = int(y + 0.001)
				toRound = not toRound
		else:
			while x <= x2:
				if notInRect(b1, x, y) and notInRect(b2, x, y):
					res = True
					break
				x += 0.5
				if toRound:
					x = int(x + 0.001)
				toRound = not toRound
		return res
	ans = 'NO'
	(wx1, wy1, wx2, wy2) = w
	for (x1, y1, x2, y2) in [[wx1, wy1, wx1, wy2], [wx2, wy1, wx2, wy2], [wx1, wy1, wx2, wy1], [wx1, wy2, wx2, wy2]]:
		if inLineButNotInRects(x1, y1, x2, y2):
			ans = 'YES'
			break
	print(ans)
	return
import sys
input = sys.stdin.buffer.readline

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]

def makeArr(defaultValFactory, dimensionArr):
	dv = defaultValFactory
	da = dimensionArr
	if len(da) == 1:
		return [dv() for _ in range(da[0])]
	else:
		return [makeArr(dv, da[1:]) for _ in range(da[0])]

def queryInteractive(i, j):
	print('? {} {}'.format(i, j))
	sys.stdout.flush()
	return int(input())

def answerInteractive(ans):
	print('! {}'.format(' '.join([str(x) for x in ans])))
	sys.stdout.flush()
inf = float('inf')
MOD = 10 ** 9 + 7
for _abc in range(1):
	main()


import sys

def intersection(x1, y1, x2, y2, x3, y3, x4, y4):
	a1 = max(x1, x3)
	b1 = max(y1, y3)
	a2 = min(x2, x4)
	b2 = min(y2, y4)
	x_dist = min(x2, x4) - max(x1, x3)
	y_dist = min(y2, y4) - max(y1, y3)
	if x_dist <= 0 or y_dist <= 0:
		return [0, 0, 0, 0]
	return [a1, b1, a2, b2]

def area(x1, y1, x2, y2):
	return (x2 - x1) * (y2 - y1)
[x1, y1, x2, y2] = [int(i) for i in sys.stdin.readline().split()]
[x3, y3, x4, y4] = [int(j) for j in sys.stdin.readline().split()]
[x5, y5, x6, y6] = [int(k) for k in sys.stdin.readline().split()]
wb1 = intersection(x1, y1, x2, y2, x3, y3, x4, y4)
wb2 = intersection(x1, y1, x2, y2, x5, y5, x6, y6)
wb1b2 = intersection(wb1[0], wb1[1], wb1[2], wb1[3], wb2[0], wb2[1], wb2[2], wb2[3])
if area(x1, y1, x2, y2) > area(wb1[0], wb1[1], wb1[2], wb1[3]) + area(wb2[0], wb2[1], wb2[2], wb2[3]) - area(wb1b2[0], wb1b2[1], wb1b2[2], wb1b2[3]):
	print('YES')
else:
	print('NO')