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.

Difficulty: introductory

Starter code:

Solutions:
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() ))

covered = False
if x3 <= x1 and y3 <= y1 and x4 >= x2 and y4 >= y2:
    covered = True
elif x5 <= x1 and y5 <= y1 and x6 >= x2 and y6 >= y2:
    covered = True
elif x1 >= x3 and x1 >= x5 and x2 <= x4 and x2 <= x6:
    if min( y4, y6 ) >= max( y3, y5 ) and min( y3, y5 ) <= y1 and max( y4, y6 ) >= y2:
        covered = True
elif y1 >= y3 and y1 >= y5 and y2 <= y4 and y2 <= y6:
    if min( x4, x6 ) >= max( x3, x5 ) and min( x3, x5 ) <= x1 and max( x4, x6 ) >= x2:
        covered = True

print( "NO" if covered else "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 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)

def __starting_point():
    main()
__starting_point()

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')


#!python3

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")








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")
    return
if l2 == 0 and l != 0:
    if (l[2] - l[0]) * (l[3] - l[1]) != pl:
        print("YES")
    else:
        print("NO")
    return
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")
    return
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")

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")
      


#!/usr/bin/env python3

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')
    return


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')
    return

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 y1 >= y3 and y2 <= y4 and x1 >= x3 and x2 <= x4:
    print("NO")
elif y1 >= y5 and y2 <= y6 and x1 >= x5 and x2 <= x6:
    print("NO")
elif x3 <= x1 and x4 >= x2 and x5 <= x1 and x6 >= x2 and y3 <= y1 <= y5 <=y4 <= y2 <= y6:
    print("NO")
elif x3 <= x1 and x4 >= x2 and x5 <= x1 and x6 >= x2 and y5 <= y1 <= y3 <=y6 <= y2 <= y4:
    print("NO")

elif y3 <= y1 and y4 >= y2 and y5 <= y1 and y6 >= y2 and x3 <= x1 <= x5 <=x4 <= x2 <= x6:
    print("NO")
elif y3 <= y1 and y4 >= y2 and y5 <= y1 and y6 >= y2 and x5 <= x1 <= x3 <=x6 <= x2 <= x4:
    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(' '))

b = True
if x3 <= x1 and x2 <= x4 and x5 <= x1 and x2 <= x6:
    if y3 <= y1 and y2 <= y6 and y4 >= y5 or y5 <= y1 and y2 <= y4 and y6 >= y3:
        b = False
if y3 <= y1 and y2 <= y4 and y5 <= y1 and y2 <= y6:
    if x3 <= x1 and x2 <= x6 and x4 >= x5 or x5 <= x1 and x2 <= x4 and x6 >= x3:
        b = False
if x3 <= x1 and y3 <= y1 and x4 >= x2 and y4 >= y2:
    b = False
if x5 <= x1 and y5 <= y1 and x6 >= x2 and y6 >= y2:
    b = False

print("YES") if b == True 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 do_mask(x1, y1, x2, y2, x3, y3, x4, y4):
    # print(x1, y1, x2, y2, x3, y3, x4, y4)
    if x1 == -1:
        return -1, -1, -1, -1
    # zenbu-kakusu
    if x3 <= x1 and x2 <= x4 and y3 <= y1 and y2 <= y4:
        return -1, -1, -1, -1

    # haba-kakusu
    if x3 <= x1 and x2 <= x4:
        if y3 <= y1 and y1 <= y4:
            y1 = y4
        if y3 <= y2 and y2 <= y4:
            y2 = y3

    # yoko-kakusu
    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")

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):
    #Fully covered:
    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")

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 (y1 > y4 or y1 < y3 or x1 > x4 or x1 < x3) and (y1 < y5 or y1 > y6 or x1 < x5 or x1 > x6):
    print('YES')
elif (y2 > y4 or y2 < y3 or x4 < x2 or x2 < x3) and (y2 < y5 or y2 > y6 or x2 < x5 or x2 > x6):
    print('YES')
elif (y2 > y4 or y2 < y3 or x4 < x1 or x1 < x3) and (y2 < y5 or y2 > y6 or x1 < x5 or x1 > x6):
    print("YES")
elif (y1 > y4 or y1 < y3 or x4 < x2 or x2 < x3) and (y1 < y5 or y1 > y6 or x2 < x5 or x2 > x6):
    print("YES")
elif x5 > x4 and x1 < x5 < x2:
    print("YES")
elif x6 < x3 and x1 < x6 < x2:
    print("YES")
elif y6 < y3 and y1 < y6 < y2:
    print('YES')
elif y5 > y4 and y1 < y5 < y2:
    print('YES')
else:
    print('NO')

ll = lambda:list(map(int, input().split()))
testcases = 1
# testcases = ll()
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
		else:
			if (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")



import sys
input = sys.stdin.readline

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 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)

#print(x1,y1,x2,y2)

x1,y1,x2,y2=cut(x1,y1,x2,y2,x5,y5,x6,y6)

#print(x1,y1,x2,y2)

if x1==x2 or y1==y2:
    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()))
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')


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])

# print(ab)
if ab==a:
    print("NO")
    return

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])

# print(ac)
if ac==a:
    print("NO")
    return

if ab[0]>=ab[2] or ab[1]>=ab[3] or ac[0]>=ac[2] or ac[1]>=ac[3]:
    print("YES")
    return

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")

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 list(zip(a, b))


first_rect = Rectangle(*list([int(x) for x in input().split(' ')]))
second_rect = Rectangle(*list([int(x) for x in input().split(' ')]))
third_rect = Rectangle(*list([int(x) for x in 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')


[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))



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
else:
    if 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")

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")

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 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")

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")
    


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]

#a[0][0] a[0][1] : a[0][0] a[0][3] : a

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')
    else:
        if x[1][2]>=x[2][0]:
            print('NO')
        else: print('YES')