Gerald bought two very rare paintings at the Sotheby's auction and he now wants to hang them on the wall. For that he bought a special board to attach it to the wall and place the paintings on the board. The board has shape of an a_1 × b_1 rectangle, the paintings have shape of a a_2 × b_2 and a_3 × b_3 rectangles.

Since the paintings are painted in the style of abstract art, it does not matter exactly how they will be rotated, but still, one side of both the board, and each of the paintings must be parallel to the floor. The paintings can touch each other and the edges of the board, but can not overlap or go beyond the edge of the board. Gerald asks whether it is possible to place the paintings on the board, or is the board he bought not large enough?


-----Input-----

The first line contains two space-separated numbers a_1 and b_1 — the sides of the board. Next two lines contain numbers a_2, b_2, a_3 and b_3 — the sides of the paintings. All numbers a_{i}, b_{i} in the input are integers and fit into the range from 1 to 1000.


-----Output-----

If the paintings can be placed on the wall, print "YES" (without the quotes), and if they cannot, print "NO" (without the quotes).


-----Examples-----
Input
3 2
1 3
2 1

Output
YES

Input
5 5
3 3
3 3

Output
NO

Input
4 2
2 3
1 2

Output
YES



-----Note-----

That's how we can place the pictures in the first test:

[Image]

And that's how we can do it in the third one.

[Image]

Difficulty: interview

Starter code:

Solutions:
a, b = [int(i) for i in input().split()]
c, d = [int(i) for i in input().split()]
e, f = [int(i) for i in input().split()]
if c+e <=a and max(d,f) <=b:
    print("YES")
elif c+e <=b and max(d,f) <=a:
    print("YES")
elif c+f <=a and max(d,e) <=b:
    print("YES")
elif c+f <=b and max(d,e) <=a:
    print("YES")
elif d+e <=a and max(c,f) <=b:
    print("YES")
elif d+e <=b and max(c,f) <=a:
    print("YES")
elif d+f <=a and max(c,e) <=b:
    print("YES")
elif d+f <=b and max(c,e) <=a:
    print("YES")
else:
    print("NO")


def check(a1, b1, a2, b2, a3, b3):
    if a2 + a3 <= a1 and b2 <= b1 and b3 <= b1:
        return True

    if b2 + b3 <= b1 and a2 <= a1 and a3 <= a1:
        return True

    return False


def __starting_point():
    a1, b1 = map(int, input().split())
    a2, b2 = map(int, input().split())
    a3, b3 = map(int, input().split())

    if check(a1, b1, a2, b2, a3, b3) or check(a1, b1, b2, a2, a3, b3) or check(a1, b1, a2, b2, b3, a3) or check(a1, b1, b2, a2, b3, a3):
        print('YES')
    else:
        print('NO')
__starting_point()

a1, b1 = list(map(int, input().split()))
a2, b2 = list(map(int, input().split()))
a3, b3 = list(map(int, input().split()))

if a1 - a2 - a3 >= 0 and b2 <= b1 and b3 <= b1:
    print("YES")
elif a1 - a2 - b3 >= 0 and b2 <= b1 and a3 <= b1:
    print("YES")
elif a1 - b2 - a3 >= 0 and a2 <= b1 and b3 <= b1:
    print("YES")
elif a1 - b2 - b3 >= 0 and a2 <= b1 and a3 <= b1:
    print("YES")
elif b1 - a2 - a3 >= 0 and b2 <= a1 and b3 <= a1:
    print("YES")
elif b1 - a2 - b3 >= 0 and b2 <= a1 and a3 <= a1:
    print("YES")
elif b1 - b2 - a3 >= 0 and a2 <= a1 and b3 <= a1:
    print("YES")
elif b1 - b2 - b3 >= 0 and a2 <= a1 and a3 <= a1:
    print("YES")
else:
    print("NO")


def ok( a , b , A , B ):

    return ( a <= A and b <= B ) or ( a <= B and b <= A )

def __starting_point():
    
    A , B = [int(x) for x in input().split()]
    a1 , b1 = [int(x) for x in input().split()]
    a2 , b2 = [int(x) for x in input().split()]

    if ok( a1 + a2 , max(b1,b2) , A , B ):
        print("YES")
    elif ok( a1 + b2 , max(b1,a2) , A , B ):
        print("YES")
    elif ok( b1 + a2 , max(a1,b2) , A , B ):
        print("YES")
    elif ok( b1 + b2 , max(a1,a2) , A , B ):
        print("YES")
    else:
        print("NO")

__starting_point()

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def test(size_x, size_y, x1, y1, x2, y2):
    if x1+x2 <= size_x and y1 <= size_y and y2 <= size_y:
        return 1
    return 0

import time

(A, B) = (int(i) for i in input().split())
(a1, b1) = (int(i) for i in input().split())
(a2, b2) = (int(i) for i in input().split())

start = time.time()
ans   = 0

ans += test(A, B, a1, b1, a2, b2)
ans += test(A, B, a1, b1, b2, a2)
ans += test(A, B, b1, a1, a2, b2)
ans += test(A, B, b1, a1, b2, a2)

ans += test(B, A, a1, b1, a2, b2)
ans += test(B, A, a1, b1, b2, a2)
ans += test(B, A, b1, a1, a2, b2)
ans += test(B, A, b1, a1, b2, a2)

if ans > 0:
    print("YES")
else:
    print("NO")

finish = time.time()
#print(finish - start)


r=lambda: map(int, input().split())

a1,b1=r()
a2,b2=r()
a3,b3=r()

ans = "NO"
for (a1,b1) in [(a1,b1), (b1,a1)]:
    for (a2,b2) in [(a2,b2), (b2,a2)]:
        for (a3,b3) in [(a3,b3), (b3,a3)]:
            if a1 >= a2 + a3 and b1 >= max(b2, b3):
                ans = "YES"

print(ans)

a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
for i in range(2):
    for j in range(2):
        if min(b[i] + c[j], max(b[1 - i], c[1 - j])) <= a[0] and max((b[i] + c[j],  max(b[1 - i], c[1 - j]))) <= a[1]:
            print("YES")
            return
        #print(b[i] + c[j], max(b[1 - i], c[1 - j]))
print("NO")
            


a, b = (int(x) for x in input().split())
a1, b1 = (int(x) for x in input().split())
a2, b2 = (int(x) for x in input().split())

if ((max(a1,a2) <= a and b1+b2 <= b) or (max(a1,a2) <= b and b1+b2 <= a) or 
	(max(b1,b2) <= a and a1+a2 <= b) or (max(b1,b2) <= b and a1+a2 <= a) or 
	(max(b1,a2) <= a and b2+a1 <= b) or (max(b1,a2) <= b and b2+a1 <= a) or 
	(max(b2,a1) <= a and b1+a2 <= b) or (max(b2,a1) <= b and b1+a2 <= a)):
	print("YES")
else:
	print("NO")

def Check(a2, b2, a3, b3):
    if a1 >= a2 + a3 and b1 >= max(b2, b3) or \
       a1 >= max(a2, a3) and b1 >= b2 + b3:
        return True
    else:
        return False

a1, b1 = list(map(int, input().split()))
a2, b2 = list(map(int, input().split()))
a3, b3 = list(map(int, input().split()))
a1, b1 = min(a1, b1), max(a1, b1)
a2, b2 = min(a2, b2), max(a2, b2)
a3, b3 = min(a3, b3), max(a3, b3)

r = Check(a2, b2, a3, b3) or \
    Check(a2, b2, b3, a3) or \
    Check(b2, a2, a3, b3) or \
    Check(b2, a2, b3, a3)
if r:
    print("YES")
else:
    print("NO")


#КОДФОРСЫ, УРА
a1, b1 = list(map(int, input().split()))
a2, b2 = list(map(int, input().split()))
a3, b3 = list(map(int, input().split()))
ans = '' 
if (a1 > b1):
    a1, b1 = b1, a1
if (a2 > b2):
    a2, b2 = b2, a2
if (a3 > b3):
    a3, b3 = b3, a3
ans = 0
if (a2 + a3 <= a1) and (max(b2, b3) <= b1):
    ans += 1
if (a2 + b3 <= a1) and (max(b2, a3) <= b1):
    ans += 1
if (a3 + b2 <= a1) and (max(a2, b3) <= b1):
    ans += 1
if (b2 + b3 <= a1) and (max(a2, a3) <= b1):
    ans += 1
if (a2 + a3 <= b1) and (max(b2, b3) <= a1):
    ans += 1
if (a2 + b3 <= b1) and (max(b2, a3) <= a1):
    ans += 1
if (a3 + b2 <= b1) and (max(a2, b3) <= a1):
    ans += 1
if (b2 + b3 <= b1) and (max(a2, a3) <= a1):
    ans += 1    
if (ans == 0):
    print('NO')
else:
    print('YES')

# mukulchandel
a1,b1=list(map(int,input().split()))
a2,b2=list(map(int,input().split()))
a3,b3=list(map(int,input().split()))
if a1>=(a2+a3) and b1>=max(b2,b3):
    print("YES")
elif a1>=(a2+b3) and b1>=max(b2,a3):
    print("YES")
elif a1>=(b2+a3) and b1>=max(a2,b3):
    print("YES")
elif a1>=(b2+b3) and b1>=max(a2,a3):
    print("YES")
elif b1>=(a2+a3) and a1>=max(b2,b3):
    print("YES")
elif b1>=(a2+b3) and a1>=max(b2,a3):
    print("YES")
elif b1>=(b2+a3) and a1>=max(a2,b3):
    print("YES")
elif b1>=(b2+b3) and a1>=max(a2,a3):
    print("YES")
else:
    print("NO")


#!/usr/bin/env python
# 560B_art.py - Codeforces.com 560B Art program
#
# Copyright (C) 2015 Sergey

"""
Gerald asks whether it is possible to place the paintings on the board,
or is the board he bought not large enough?
Input

The first line contains two space-separated numbers a1 and b1 the sides
of the board. Next two lines contain numbers a2 b2 a3 and b3 the sides
of the paintings. All numbers ai,?bi in the input are integers and fit into
the range from 1 to 1000.

Output

If the paintings can be placed on the wall, print "YES" (without the quotes),
and if they cannot, print "NO" (without the quotes).
"""

# Standard modules
import unittest
import sys

# Additional modules


###############################################################################
# Art Class
###############################################################################


class Art:
    """ Art representation """

    def __init__(self, args):
        """ Default constructor """

        self.numa, self.numb = args

        self.r = self.rect(self.numa[0], self.numb[0])
        self.rmax = self.rect(self.numa[1], self.numb[1])
        self.rmin = self.rect(self.numa[2], self.numb[2])
        if self.rmax[0] < self.rmax[1]:
            self.rmax, self.rmin = self.rmin, self.rmax

        self.remain = []
        if self.rmax[0] < self.r[0] and self.rmax[1] <= self.r[1]:
            self.remain.append((self.r[0] - self.rmax[0], self.r[1]))
        if self.rmax[1] < self.r[1] and self.rmax[0] <= self.r[0]:
            self.remain.append((self.r[0], self.r[1] - self.rmax[1]))

        if self.rmax[1] < self.r[0] and self.rmax[0] <= self.r[1]:
            self.remain.append((self.r[0] - self.rmax[1], self.r[1]))
        if self.rmax[0] < self.r[1] and self.rmax[1] <= self.r[0]:
            self.remain.append((self.r[0], self.r[1] - self.rmax[0]))

    def rect(self, a, b):
        if a > b:
            return (a, b)
        else:
            return (b, a)

    def calculate(self):
        """ Main calcualtion function of the class """

        for rec in self.remain:
            if self.rmin[0] <= rec[0] and self.rmin[1] <= rec[1]:
                return "YES"
            if self.rmin[1] <= rec[0] and self.rmin[0] <= rec[1]:
                return "YES"
        return "NO"


###############################################################################
# Helping classes
###############################################################################


###############################################################################
# Art Class testing wrapper code
###############################################################################


def get_inputs(test_inputs=None):

    it = iter(test_inputs.split("\n")) if test_inputs else None

    def uinput():
        """ Unit-testable input function wrapper """
        if it:
            return next(it)
        else:
            return sys.stdin.readline()

    # Getting string inputs. Place all uinput() calls here
    imax = 3
    numnums = list(map(int, " ".join(uinput() for i in range(imax)).split()))

    # Splitting numnums into n arrays
    numa = []
    numb = []
    for i in range(0, 2*imax, 2):
        numa.append(numnums[i])
        numb.append(numnums[i+1])

    # Decoding inputs into a list
    return [numa, numb]


def calculate(test_inputs=None):
    """ Base class calculate method wrapper """
    return Art(get_inputs(test_inputs)).calculate()


###############################################################################
# Unit Tests
###############################################################################


class unitTests(unittest.TestCase):

    def test_Art_class__basic_functions(self):
        """ Art class basic functions testing """

        # Constructor test
        d = Art([[3, 1, 2], [2, 3, 1]])
        self.assertEqual(d.numa[0], 3)

        self.assertEqual(d.r, (3, 2))
        self.assertEqual(d.rmax, (3, 1))
        self.assertEqual(d.rmin, (2, 1))

        self.assertEqual(d.remain, [(3, 1)])

    def test_sample_tests(self):
        """ Quiz sample tests. Add \n to separate lines """

        # Sample test 1
        test = "3 2\n1 3\n2 1"
        self.assertEqual(calculate(test), "YES")
        self.assertEqual(list(get_inputs(test)[0]), [3, 1, 2])
        self.assertEqual(list(get_inputs(test)[1]), [2, 3, 1])

        # Sample test 2
        test = "5 5\n3 3\n3 3"
        self.assertEqual(calculate(test), "NO")

        # Sample test 3
        test = "4 2\n2 3\n1 2"
        self.assertEqual(calculate(test), "YES")

        # My test 4
        test = "5 5\n1 5\n1 5"
        self.assertEqual(calculate(test), "YES")

    def test_time_limit_test(self):
        """ Quiz time limit test """

        import random

        # Time limit test
        test = "1000 1000"
        test += "\n900 900"
        test += "\n50 50"

        import timeit

        start = timeit.default_timer()
        args = get_inputs(test)

        init = timeit.default_timer()
        d = Art(args)

        calc = timeit.default_timer()
        d.calculate()

        stop = timeit.default_timer()
        print((
            "\nTime Test: " +
            "{0:.3f}s (inp {1:.3f}s init {2:.3f}s calc {3:.3f}s)".
            format(stop-start, init-start, calc-init, stop-calc)))

def __starting_point():

    # Avoiding recursion limitaions
    sys.setrecursionlimit(100000)

    if sys.argv[-1] == "-ut":
        unittest.main(argv=[" "])

    # Print the result string
    sys.stdout.write(calculate())

__starting_point()

a1, b1 = map(int, input().split())
a2, b2 = map(int, input().split())
a3, b3 = map(int, input().split())

if (max(a2, a3) <= a1 and b2 + b3 <= b1) or \
   (max(a2, b3) <= a1 and b2 + a3 <= b1) or \
   (max(b2, a3) <= a1 and a2 + b3 <= b1) or \
   (max(b2, b3) <= a1 and a2 + a3 <= b1) or \
   (a2 + a3 <= a1 and max(b2, b3) <= b1) or \
   (a2 + b3 <= a1 and max(b2, a3) <= b1) or \
   (b2 + a3 <= a1 and max(a2, b3) <= b1) or \
   (b2 + b3 <= a1 and max(a2, a3) <= b1):
    print("YES")
else:
    print("NO")

r = lambda: input()
ri = lambda: int(r())
rr = lambda: map(int, r().split())
rl = lambda: list(rr())

a1, b1 = rr()
a2, b2 = rr()
a3, b3 = rr()

def f(x, y):
    fa = x <= a1 and y <= b1
    fb = x <= b1 and y <= a1
    return fa or fb

f1 = f(max(b2, b3), a2 + a3)
f2 = f(max(a2, a3), b2 + b3)
f3 = f(max(a2, b3), b2 + a3)
f4 = f(max(b2, a3), a2 + b3)

ans = f1 or f2 or f3 or f4
print('YES' if ans else 'NO')

x, y = map(int, input().split(" "))
a2, b2 = map(int, input().split(" "))
a3, b3 = map(int, input().split(" "))

if (x>= a2+a3 and y >= b2 and y>= b3) or (x>= b2+b3 and y>= a2 and y>= a3) or (x >= a2+b3 and y >= a3 and y>= b2) or (x>=a3+b2 and y >= a2 and y >= b3) or (y>= a2+a3 and x >= b2 and x>= b3) or (y>= b2+b3 and x>= a2 and x>= a3) or (y >= a2+b3 and x >= a3 and x>= b2) or (y>=a3+b2 and x>= a2 and x >= b3):
    print("YES")
else:
    print("NO")

a1, b1 = list(map(int, input().split()))
a2, b2 = list(map(int, input().split()))
a3, b3 = list(map(int, input().split()))

if a2+b3<=b1:
    if max(a3,b2)<=a1:
        print("YES")
        return
if a2+b3<=a1:
    if max(a3,b2)<=b1:
        print("YES")
        return

if a2+a3<=b1:
    if max(b2,b3)<=a1:
        print("YES")
        return
if a2+a3<=a1:
    if max(b2,b3)<=b1:
        print("YES")
        return
if b2+a3<=a1:
    if max(a2,b3)<=b1:
        print("YES")
        return
if b2+a3<=b1:
    if max(a2,b3)<=a1:
        print("YES")
        return
if b2+b3<=a1:
    if max(a2,a3)<=b1:
        print("YES")
        return
if b2+b3<=b1:
    if max(a2,a3)<=a1:
        print("YES")
        return
print("NO")


a, b = map(int, input().split())
a1, b1 = map(int, input().split())
a2, b2 = map(int, input().split())

flag = False

x = a1 + a2
bigger = max([b1, b2])
if x <= a:
	if bigger <= b:
		flag = True
if x <= b:
	if bigger <= a:
		flag = True

x = a1 + b2
bigger = max([b1, a1])
if x <= a:
	if bigger <= b:
		flag = True
if x <= b:
	if bigger <= a:
		flag = True

x = b1 + b2
bigger = max([a1, a2])
if x <= a:
	if bigger <= b:
		flag = True
if x <= b:
	if bigger <= a:
		flag = True

x = b1 + a2
bigger = max([a1, b2])
if x <= a:
	if bigger <= b:
		flag = True
if x <= b:
	if bigger <= a:
		flag = True


if flag:
	print("YES")
else:
	print("NO")

def main():
	a, b = list(map(int, input().split()))
	obj = [None, None]
	obj[0] = list(map(int, input().split()))
	obj[1] = list(map(int, input().split()))

	#portrait
	def vlezet(a, b, i, j, sx, sy):
		return (i + sx <= a) and (j + sy <= b)


	if vlezet(a, b, 0, 0, *obj[0]):
		x = obj[0][0]
		y = obj[0][1]
		if vlezet(a, b, x, 0, *obj[1]) or vlezet(a, b, x, 0, obj[1][1], obj[1][0]):
			print('YES')
			return 0
		elif vlezet(a, b, 0, y, *obj[1]) or vlezet(a, b, 0, y, obj[1][1], obj[1][0]):
			print('YES')
			return 0


	obj[0][1], obj[0][0] = obj[0][0], obj[0][1]
	if vlezet(a, b, 0, 0, *obj[0]):
		x = obj[0][0]
		y = obj[0][1]
		if vlezet(a, b, x, 0, *obj[1]) or vlezet(a, b, x, 0, obj[1][1], obj[1][0]):
			print('YES')
			return 0
		elif vlezet(a, b, 0, y, *obj[1]) or vlezet(a, b, 0, y, obj[1][1], obj[1][0]):
			print('YES')
			return 0
	print('NO')
	return 0

main()



def fitVertical( A , B ):
	if( B[ 0 ] <= A[ 0 ] and B[ 1 ] <= A[ 1 ] ):
		return [ A[ 0 ] - B[ 0 ] , A[ 1 ] - B[ 1 ] ]
	return [ -1 , -1 ]

def fitHorizontal( A , B ):
	if( B[ 1 ] <= A[ 0 ] and B[ 0 ] <= A[ 1 ] ):
		return [ A[ 0 ] - B[ 1 ] , A[ 1 ] - B[ 0 ] ]
	return [ -1 , -1 ]

A = input().split()
B = input().split()
C = input().split()

A = [ int(x) for x in A ]
B = [ int(x) for x in B ]
C = [ int(x) for x in C ]

D = fitVertical( A , B )

if( D[ 0 ] != -1 ):
	
	if( fitVertical( [ D[ 0 ] , A[ 1 ] ] , C )[ 0 ] != -1 or fitHorizontal( [ D[ 0 ] , A[ 1 ] ] , C )[ 0 ] != -1 ):
		print( "YES" )
		return


	if( fitVertical( [ D[ 1 ] , A[ 0 ] ] , C )[ 0 ] != -1 or fitHorizontal( [ D[ 1 ] , A[ 0 ] ] , C )[ 0 ] != -1 ):
		print( "YES" )
		return

D = fitHorizontal( A , B )

if( D[ 0 ] != -1 ):

	if( fitVertical( [ D[ 0 ] , A[ 1 ] ] , C )[ 0 ] != -1 or fitHorizontal( [ D[ 0 ] , A[ 1 ] ] , C )[ 0 ] != -1 ):
		print( "YES" )
		return

	if( fitVertical( [ D[ 1 ] , A[ 0 ] ] , C )[ 0 ] != -1 or fitHorizontal( [ D[ 1 ] , A[ 0 ] ] , C )[ 0 ] != -1 ):
		print( "YES" )
		return

print( "NO" )





def solve(cnt,f1,f2,f3,nowx,nowy,cur):
    if nowx<0 or nowy<0 or cur<0:
        return False
    if f1==1 and f2==1 and f3==1:
        return True
    else:
        if f1!=1:
            return solve(cnt+1,1,0,0,a,b,cur)or solve(cnt+1,1,0,0,b,a,cur)
        if f2!=1:
            return solve(cnt+1,1,1,0,nowx-a1,nowy,nowy-b1)or solve(cnt+1,1,1,0,nowx-b1,nowy,nowy-a1)
        if f3!=1:
            return solve(cnt+1,1,1,1,nowx-a2,nowy,nowy-b2)or solve(cnt+1,1,1,1,nowx-b2,nowy,nowy-a2)
a,b=map(int,input().split())
a1,b1=map(int,input().split())
a2,b2=map(int,input().split())
if solve(0,0,0,0,0,0,0):
    print("YES")    
else:
    print("NO")

# zadacha B
a, b = list(map(int, input().split()))
k1, k2 = list(map(int, input().split()))
k3, k4 = list(map(int, input().split()))

if (k1 + k3 <= a and (k2 <= b and k4 <= b)) or (k1 + k3 <= b and (k2 <= a and k4 <= a)) or (
                    k1 + k4 <= a and (k2 <= b and k4 <= b)) or (k1 + k4 <= b and (k2 <= a and k4 <= a)) or (
                    k2 + k4 <= a and (k1 <= b and k3 <= b)) or (
                    k2 + k4 <= b and (k1 <= a and k3 <= a)) or (k1 + k4 <= a and (k2 <= b and k3 <= b)) or (
            k1 + k4 <= b and (k2 <= a and k3 <= a)) or (k2 + k3 <= a and (k1 <= b and k4 <= b)) or (
            k2 + k3 <= b and (k1 <= a and k4 <= a)):
    print("YES")
else:
    print("NO")


a1,b1=map(int,input().split())
a2,b2=map(int,input().split())
a3,b3=map(int,input().split())
if a2+a3<=a1 and max(b2,b3)<=b1: print('YES')
elif b2+b3<=b1 and max(a2,a3)<=a1: print('YES')
elif a2+a3<=b1 and max(b2,b3)<=a1: print('YES')
elif b2+b3<=a1 and max(a2,a3)<=b1: print('YES')
elif a2+b3<=b1 and max(b2,a3)<=a1: print('YES')
elif a2+b3<=a1 and max(b2,a3)<=b1: print('YES')
elif b2+a3<=b1 and max(a2,b3)<=a1: print('YES')
elif b2+a3<=a1 and max(a2,b3)<=b1: print('YES')
else: print('NO')

n, m = [int(x) for x in input().split()]
n, m = sorted([n, m])
x1, y1 = [int(x) for x in input().split()]
x2, y2 = [int(x) for x in input().split()]
if (y1 + y2 <= m) and (max(x1, x2) <= n):
    print("YES")
elif (max(y1, y2) <= m) and (x1 + x2 <= n):
    print("YES")
elif (y1 + x2 <= m) and (max(x1, y2) <= n):
    print("YES")
elif (max(y1, x2) <= m) and (x1 + y2 <= n):
    print("YES")
elif (x1 + y2 <= m) and (max(y1, x2) <= n):
    print("YES")
elif (max(x1, y2) <= m) and (y1 + x2 <= n):
    print("YES")
elif (y1 + y2 <= n) and (max(x1, x2) <= m):
    print("YES")
elif (max(y1, y2) <= n) and (x1 + x2 <= m):
    print("YES")
else:
    #print(x1+x2, y1+y2)
    #print(x1+y2, y1+x2)
    print("NO")

a1, b1 = map(int, input().split())
a2, b2 = map(int, input().split())
a3, b3 = map(int, input().split())

if a1 < b1:
    a1, b1 = b1, a1

if max([a2, b2, a3, b3]) > a1:
    print('NO')
else:
    if (a2 + a3 <= a1) and (max(b2, b3) <= b1):
        print('YES')
    elif (a2 + b3 <= a1) and (max(b2, a3) <= b1):
        print('YES')
    elif (b2 + a3 <= a1) and (max(a2, b3) <= b1):
        print('YES')
    elif (b2 + b3 <= a1) and (max(a2, a3) <= b1):
        print('YES')
    elif (a2 + a3 <= b1) and (max(b2, b2) <= a1):
        print('YES')
    elif (a2 + b3 <= b1) and (max(b2, a3) <= a1):
        print('YES')
    elif (b2 + a3 <= b1) and (max(a2, b3) <= a1):
        print('YES')
    elif (b2 + b3 <= b1) and (max(a2, a3) <= a1):
        print('YES')
    else:
        print('NO')