The progress is not standing still in Berland. Recently all garbage containers in Bertown, the capital of Berland, were replaced by differentiated recycling bins, each accepting some category of waste. While this will definitely improve the ecological situation, for some citizens it's difficult to get used to the habit of sorting waste.

Monocarp is one of those citizens who tries to get used to waste sorting. Today he has to take out the trash from his house. There are three containers near the Monocarp's house, the first one accepts paper waste, the second one accepts plastic waste, and the third one — all other types of waste. It is possible to fit $c_1$ items into the first container, $c_2$ items into the second container and $c_3$ items into the third container.

Monocarp has a lot of items to throw into containers. Some are made of paper, so Monocarp has to put them into the first container (he has $a_1$ such items), some are made of plastic, so he has to put them into the second container (he has $a_2$ such items), and some are neither paper nor plastic — so Monocarp has to put them into the third container (he has $a_3$ such items).

Unfortunately, there are also two categories of items that Monocarp is unsure of: he has $a_4$ items which are partially made of paper, so he will put each of these items either into the first container or into the third container. Similarly, he has $a_5$ items partially made of plastic, so he has to put each of them either into the second container or into the third container. Obviously, this choice is made separately for each item — for example, Monocarp can throw several partially-plastic items into the second container, and all other partially-plastic items — into the third one.

Now Monocarp wonders: is it possible to put each item into some container so that the first container will hold no more than $c_1$ items, the second one — no more than $c_2$ items, and the third one — no more than $c_3$ items?


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 3 \cdot 10^4$) — the number of test cases.

Each test case consists of two lines. The first line of each test case contains three integers $c_1$, $c_2$, $c_3$ ($0 \le c_1, c_2, c_3 \le 10^8$) — the capacities of the containers.

The second line of each test case contains five integers $a_1$, $a_2$, $a_3$, $a_4$, $a_5$ ($0 \le a_i \le 10^8$), where $a_i$ is the number of items of the $i$-th category Monocarp has to throw out ($i = 1$ is paper waste, $i = 2$ is plastic waste, $i = 3$ is general waste, $i = 4$ is partially-paper waste, $i = 5$ is partially-plastic waste).


-----Output-----

For each test case, print either YES if it is possible to fit all items into containers, or NO otherwise. You may print each letter in any case (for example, YES, Yes, yes, yEs will all be recognized as positive answer).


-----Examples-----

Input
7
1 2 3
1 2 3 0 0
2 2 3
1 2 3 1 0
2 2 3
1 2 3 0 1
1 2 5
1 2 3 1 1
0 0 0
0 0 0 0 0
0 0 4
1 0 0 0 0
13 37 42
0 0 0 40 47
Output
YES
YES
NO
YES
YES
NO
YES


-----Note-----

Explanations for the example test cases:

Monocarp can put $1$ item of paper waste into the first container, $2$ items of plastic waste into the second container, and $3$ items of general waste into the third container;

Monocarp can put $1$ item of paper waste and $1$ item of partially-paper waste into the first container, $2$ items of plastic waste into the second container, and $3$ items of general waste into the third container;

there is no answer since either the second container should contain $3$ items, or the third container should contain $4$ items;

Monocarp can put $1$ item of paper waste into the first container, $2$ items of plastic waste into the second container, and $3$ items of general waste, $1$ item of partially-paper waste and $1$ item of partially-plastic waste into the third container;

there is no waste at all, so all containers can be left empty;

there's no answer since it's impossible to put a paper item into the third container;

Monocarp can put $10$ items of partially-paper waste into the first container, $37$ items of partially-plastic waste into the second container, and $30$ items of partially-paper waste and $10$ items of partially-plastic waste into the third container.

Difficulty: EASY
Tags: Implementation

Greedy algorithms
Skill types: Greedy algorithms

Starter code:

Solutions:
def check(c, a):
	update = []
	for i in range(3):
		update.append(c[i] - a[i])
		if update[i] < 0:
			return 'NO'
	if update[0] + update[2] >= a[3]:
		left = a[3] - update[0]
		if left > 0:
			update[2] = update[2] - left
			if update[2] < 0:
				return 'NO'
		if update[1] + update[2] >= a[4]:
			return 'YES'
		else:
			return 'NO'
	else:
		return 'NO'
t = int(input())
while t > 0:
	c = [int(x) for x in input().strip().split()]
	a = [int(x) for x in input().strip().split()]
	print(check(c, a))
	t = t - 1


from collections import defaultdict
import sys

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

def ls():
	return list(map(int, list(input())))

def la():
	return list(input())

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

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
t = ii()

def default_value():
	return 0
for i in range(t):
	(c1, c2, c3) = li()
	(a1, a2, a3, a4, a5) = li()
	ans = 'YES'
	if c1 >= a1 and c2 >= a2 and (c3 >= a3):
		c1 = c1 - a1
		c2 = c2 - a2
		c3 = c3 - a3
	else:
		print('NO')
		continue
	if a4 <= c1 + c3:
		c1 = c1 - a4
		if c1 < 0:
			c3 += c1
	else:
		print('NO')
		continue
	if a5 > c2 + c3:
		print('NO')
		continue
	print('YES')


results = []
num_test = int(input())
for i in range(num_test):
	containers = [int(x) for x in input().split()]
	trash = [int(x) for x in input().split()]
	paper_left = max(trash[0] + trash[3] - containers[0], 0)
	plastic_left = max(trash[1] + trash[4] - containers[1], 0)
	if containers[0] < trash[0] or containers[1] < trash[1] or containers[2] < trash[2]:
		results.append('NO')
	elif paper_left + plastic_left <= containers[2] - trash[2]:
		results.append('YES')
	else:
		results.append('NO')
[print(x) for x in results]


from sys import stdin

def Readlines():
	for data in stdin.read().split('\n'):
		yield data

def main():
	(lines, result) = (Readlines(), list())
	readln = lambda : next(lines)
	for t in range(int(readln())):
		c = list(map(int, readln().split()))
		a = list(map(int, readln().split()))
		for i in range(5):
			b = min(c[i % 3], a[i])
			(c[i % 3], a[i]) = (c[i % 3] - b, a[i] - b)
		a[3] += a.pop()
		a[3] -= min(a[3], c[2])
		if sum(a):
			result.append('No')
		else:
			result.append('Yes')
	print(*result, sep='\n')
main()


for _ in range(int(input())):
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	if b[0] > a[0] or b[1] > a[1] or b[2] > a[2]:
		print('No')
		continue
	if max(-a[0] + b[0] + b[3], 0) + max(-a[1] + b[1] + b[4], 0) <= a[2] - b[2]:
		print('Yes')
	else:
		print('No')


t = int(input())
for _ in range(t):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if a1 > c1:
		print('NO')
		continue
	c1 -= a1
	if a2 > c2:
		print('NO')
		continue
	c2 -= a2
	if a3 > c3:
		print('NO')
		continue
	c3 -= a3
	l4 = min(a4, c1)
	c1 -= l4
	a4 -= l4
	if a4 > c3:
		print('NO')
		continue
	c3 -= a4
	l5 = min(a5, c2)
	c2 -= l5
	a5 -= l5
	if a5 > c3:
		print('NO')
		continue
	c3 -= a5
	print('YES')


for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if a1 > c1 or a2 > c2 or a3 > c3:
		print('NO')
	else:
		c1 = c1 - a1
		c2 = c2 - a2
		c3 = c3 - a3
		k = a4 - min(c1, a4)
		l = a5 - min(c2, a5)
		if k + l <= c3:
			print('YES')
		else:
			print('NO')


for t in range(int(input())):
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if c[0] >= a[0] and c[1] >= a[1] and (c[2] >= a[2]) and (c[0] + c[2] >= a[0] + a[2] + a[3]) and (c[1] + c[2] >= a[1] + a[2] + a[4]) and (sum(c) >= sum(a)):
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	(c1, c2, c3) = tuple(map(int, input().split()))
	(a1, a2, a3, a4, a5) = tuple(map(int, input().split()))
	c1 = c1 - a1
	c2 = c2 - a2
	c3 = c3 - a3
	if min(c1, c2, c3) < 0:
		print('NO')
	else:
		if a4 > c1:
			a4 = a4 - c1
		else:
			a4 = 0
		if a5 > c2:
			a5 = a5 - c2
		else:
			a5 = 0
		if c3 >= a4 + a5:
			print('YES')
		else:
			print('NO')


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
from collections import deque
import threading
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')

class SegmentTree:

	def __init__(self, data, default=10 ** 10, func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)
MOD = 10 ** 9 + 7

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD
mod = 10 ** 9 + 7
omod = 998244353
for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	a = list(map(int, input().split()))
	ch = 1
	if a[0] > c1 or a[1] > c2 or a[2] > c3:
		ch = 0
		print('No')
		continue
	c1 -= a[0]
	c2 -= a[1]
	c3 -= a[2]
	a[3] -= min(a[3], c1)
	a[4] -= min(a[4], c2)
	if a[3] + a[4] > c3:
		print('NO')
		continue
	print('YES')


t = int(input())
for _ in range(t):
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	c[0] -= a[0]
	c[1] -= a[1]
	c[2] -= a[2]
	if c[0] < 0 or c[1] < 0 or c[2] < 0:
		print('NO')
		continue
	if c[0] >= a[3]:
		c[0] -= a[3]
		a[3] = 0
	else:
		a[3] -= c[0]
		c[0] = 0
		c[2] -= a[3]
	if c[1] >= a[4]:
		c[1] -= a[4]
		a[4] = 0
	else:
		a[4] -= c[1]
		c[1] = 0
		c[2] -= a[4]
	if c[2] >= 0:
		print('YES')
	else:
		print('NO')


ans = ['YES', 'NO']
T = int(input())
while T:
	T -= 1
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	(l1, l2, l3) = (c1 - a1, c2 - a2, c3 - a3)
	sol = 0
	if l1 < 0 or l2 < 0 or l3 < 0:
		sol = 1
	else:
		if a4 <= l1 + l3:
			mn = min(l1, a4)
			l1 -= mn
			a4 -= mn
			if a4:
				l3 -= a4
		else:
			sol = 1
		if a5 <= l2 + l3:
			mn = min(l1, a5)
			l2 -= mn
			a5 -= mn
			if a5:
				l3 -= a4
		else:
			sol = 1
	print(ans[sol])


test_cases = int(input())
for i in range(test_cases):
	(paper_limit, plastic_limit, other_limit) = map(int, input().split())
	wastes = list(map(int, input().split()))
	if wastes[0] > paper_limit or wastes[1] > plastic_limit or wastes[2] > other_limit:
		print('NO')
	else:
		paper_limit = paper_limit - wastes[0]
		plastic_limit = plastic_limit - wastes[1]
		other_limit = other_limit - wastes[2]
		if wastes[3] > paper_limit + other_limit:
			print('NO')
		else:
			if paper_limit < wastes[3]:
				other_limit = other_limit - (wastes[3] - paper_limit)
			if wastes[4] > plastic_limit + other_limit:
				print('NO')
			else:
				print('YES')


t = int(input())
while t > 0:
	(x, y, z) = input().split()
	x = int(x)
	y = int(y)
	z = int(z)
	(a1, a2, a3, a4, a5) = input().split()
	a1 = int(a1)
	a2 = int(a2)
	a3 = int(a3)
	a4 = int(a4)
	a5 = int(a5)
	if x >= a1 and y >= a2 and (z >= a3) and (x + z - (a1 + a3) >= a4) and (y + z - (a2 + a3) >= a5) and (x + y + z - (a1 + a2 + a3) >= a4 + a5):
		print('YES')
	else:
		print('NO')
	t -= 1


for x in range(0, int(input())):
	(ca, cb, cc) = map(int, input().split())
	(a, b, c, d, e) = map(int, input().split())
	ca -= a
	cb -= b
	cc -= c
	if ca < 0 or cb < 0 or cc < 0:
		print('NO')
	else:
		d -= ca
		e -= cb
		if d < 0:
			d = 0
		if e < 0:
			e = 0
		if d + e <= cc:
			print('YES')
		else:
			print('NO')


import math
t = int(input())
for _ in range(t):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	r1 = a1 + a4
	r2 = a2 + a5
	r3 = a3
	if r1 > c1:
		r3 += r1 - c1
	if r2 > c2:
		r3 += r2 - c2
	if r3 > c3:
		print('NO')
	elif a1 <= c1 and a2 <= c2:
		print('YES')
	else:
		print('NO')


for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	l = [int(x) for x in input().split()]
	sumv = sum(l)
	sumi = a + b + c
	if l[0] > a or l[1] > b:
		print('NO')
	elif sumv > sumi:
		print('NO')
	else:
		s = 'NO'
		counter = 0
		c = c - l[2]
		sump = l[0] + l[3]
		if a + c >= sump:
			counter += 1
			rema = 0
			if sump >= a:
				c = c - (sump - a)
		sumnp = l[1] + l[4]
		if b + c >= sumnp:
			counter += 1
			remb = 0
			if sumnp >= b:
				c = c - (sumnp - b)
		if c < 0:
			print(s)
		elif counter == 2:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if c[0] >= a[0] and c[1] >= a[1] and (c[2] >= a[2]):
		c = [c[i] - a[i] for i in range(3)]
		a[3] -= c[0]
		a[4] -= c[1]
		if max(0, a[3]) + max(0, a[4]) <= c[2]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


for i in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a, b, c, d, e) = map(int, input().split())
	flag = True
	c1 -= a
	if c1 < 0:
		print('NO')
		continue
	c2 -= b
	if c2 < 0:
		print('NO')
		continue
	c3 -= c
	if c3 < 0:
		print('NO')
		continue
	d -= min(d, c1)
	e -= min(e, c2)
	if c3 >= e + d:
		print('YES')
	else:
		print('NO')


import sys

def calculate(c1, c2, c3, a1, a2, a3, a4, a5):
	c1 -= a1
	if c1 < 0:
		return 'NO'
	c2 -= a2
	if c2 < 0:
		return 'NO'
	c3 -= a3
	if c3 < 0:
		return 'NO'
	a4 -= min(a4, c1)
	a5 -= min(a5, c2)
	if c3 < a4 + a5:
		return 'NO'
	return 'YES'
test_count = int(sys.stdin.readline())
for _ in range(test_count):
	(c1, c2, c3) = map(int, sys.stdin.readline().strip().split(' '))
	(a1, a2, a3, a4, a5) = map(int, sys.stdin.readline().strip().split(' '))
	answer = calculate(c1, c2, c3, a1, a2, a3, a4, a5)
	sys.stdout.write(f'{answer}\n')


t = int(input())
while t > 0:
	t -= 1
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if c1 < a1 or c2 < a2 or c3 < a3:
		print('NO')
	else:
		c1 -= a1
		c2 -= a2
		c3 -= a3
		if a4 <= c1:
			if a5 <= c2 + c3:
				print('YES')
			else:
				print('NO')
		else:
			a4 -= c1
			if a4 <= c3:
				c3 -= a4
				if a5 <= c2 + c3:
					print('YES')
				else:
					print('NO')
			else:
				print('NO')


t = int(input())
ans = ''
for j in range(t):
	C = [int(i) for i in input().split()]
	A = [int(i) for i in input().split()]
	if C[0] >= A[0] and C[1] >= A[1] and (C[1] >= A[1]) and (C[2] >= A[2] + max(0, A[0] + A[3] - C[0]) + max(0, A[1] + A[4] - C[1])):
		ans += 'YES \n'
	else:
		ans += 'NO \n'
print(ans)


from typing import List

def valid(limits: List[int], elements: List[int]) -> bool:
	for index in range(3):
		limits[index] = limits[index] - elements[index]
		if limits[index] < 0:
			return False
	elements[3] = elements[3] - min(elements[3], limits[0])
	elements[4] = elements[4] - min(elements[4], limits[1])
	return elements[3] + elements[4] <= limits[2]

def read_input(filename: str=None) -> None:
	from sys import stdin
	stdin = open(filename) if filename else stdin
	cases = int(stdin.readline())
	while cases:
		cases = cases - 1
		limits = list(map(int, stdin.readline().split()))
		elements = list(map(int, stdin.readline().split()))
		print('YES') if valid(limits, elements) else print('NO')

def main():
	read_input()
main()


from sys import stdin
tt = int(stdin.readline())
for loop in range(tt):
	(c1, c2, c3) = map(int, stdin.readline().split())
	(a1, a2, a3, a4, a5) = map(int, stdin.readline().split())
	if a1 > c1 or a2 > c2 or a3 > c3:
		print('No')
		continue
	c1 -= a1
	c2 -= a2
	c3 -= a3
	a4 -= c1
	if a4 > 0:
		c3 -= a4
	a5 -= c2
	if a5 > 0:
		c3 -= a5
	if c3 >= 0:
		print('Yes')
	else:
		print('No')


import os
import math
import statistics
true = True
false = False
from functools import reduce
is_dev = 'vscode' in os.environ
if is_dev:
	inF = open('in.txt', 'r')
	outF = open('out.txt', 'w')

def ins():
	return list(map(int, input_().split(' ')))

def inss():
	return list(input_().split(' '))

def input_():
	if is_dev:
		return inF.readline()[:-1]
	else:
		return input()

def ranin():
	return range(int(input_()))

def print_(data):
	if is_dev:
		outF.write(str(data) + '\n')
	else:
		print(data)
epsilon = 1e-07
for _ in range(int(input_())):
	(c1, c2, c3) = ins()
	(a1, a2, a3, a4, a5) = ins()
	c1 -= a1
	c2 -= a2
	c3 -= a3
	if c1 < 0 or c2 < 0 or c3 < 0:
		print_('NO')
	else:
		a4 -= c1
		a4 = max(a4, 0)
		a5 -= c2
		a5 = max(a5, 0)
		c3 -= a4 + a5
		if c3 < 0:
			print_('NO')
		else:
			print_('YES')
if is_dev:
	outF.close()

	def compare_file():
		print(open('out.txt', 'r').read() == open('outactual.txt', 'r').read())
	compare_file()


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

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

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

def N():
	return int(input())

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

def print_list(l):
	print(' '.join(map(str, l)))
for _ in range(N()):
	c = RLL()
	a = RLL()
	print('YES' if a[0] <= c[0] and a[1] <= c[1] and (max(0, a[3] + a[0] - c[0]) + max(0, a[4] + a[1] - c[1]) + a[2] <= c[2]) else 'NO')


def isvalid(c1, c2, c3, x1, x2, x3, x4, x5):
	d1 = c1 - x1
	d2 = c2 - x2
	d3 = c3 - x3
	if d1 > 0:
		x1 = x1 + min(d1, x4)
		x4 = x4 - min(d1, x4)
	if d2 > 0:
		x2 = x2 + min(d2, x5)
		x5 = x5 - min(d2, x5)
	x3 += x4 + x5
	if x3 > c3 or c1 < x1 or c2 < x2:
		return False
	return True
t = int(input())
for _ in range(t):
	(c1, c2, c3) = map(int, input().split())
	(x1, x2, x3, x4, x5) = map(int, input().split())
	if isvalid(c1, c2, c3, x1, x2, x3, x4, x5):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(b1, b2, b3) = map(int, input().split())
	(t1, t2, t3, t4, t5) = map(int, input().split())
	if b1 >= t1 and b2 >= t2 and (b3 >= t3) and (b1 + b3 >= t1 + t3 + t4) and (b2 + b3 >= t2 + t3 + t5) and (b1 + b2 + b3 >= t1 + t2 + t3 + t4 + t5):
		print('YES')
	else:
		print('NO')


def solve():
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	c[0] -= a[0]
	c[1] -= a[1]
	c[2] -= a[2]
	if c[0] < 0 or c[1] < 0 or c[2] < 0:
		print('NO')
		return
	if a[3] <= c[0]:
		a[3] = 0
	else:
		a[3] -= c[0]
	if a[4] <= c[1]:
		a[4] = 0
	else:
		a[4] -= c[1]
	if a[3] + a[4] > c[2]:
		print('NO')
	else:
		print('YES')
for _ in range(int(input())):
	solve()


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
import string
ORDA = 97

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

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

def li():
	return [int(i) for i in input().split()]

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

def revn(n):
	return str(n)[::-1]

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

def ddl():
	return collections.defaultdict(list)

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

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

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

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for _ in range(ii()):
	c = li()
	a = li()
	if c[0] < a[0] or c[1] < a[1] or c[2] < a[2]:
		print('NO')
	else:
		c[0] -= a[0]
		a[0] = 0
		c[1] -= a[1]
		a[1] = 0
		c[2] -= a[2]
		a[2] = 0
		remains = min(c[0], a[3])
		c[0] -= remains
		a[3] -= remains
		remains = min(c[1], a[4])
		c[1] -= remains
		a[4] -= remains
		if sum(a[3:]) > c[2]:
			print('NO')
		else:
			print('YES')


t = int(input())
for q in range(t):
	(c1, c2, c3) = map(int, input().split(' '))
	(a1, a2, a3, a4, a5) = map(int, input().split(' '))
	(b1, b2, b3) = (a1, a2, a3)
	flag = 0
	if c1 < a1 or c2 < a2 or c3 < a3:
		flag = 1
	c1 -= a1
	c2 -= a2
	c3 -= a3
	a4 -= c1
	a5 -= c2
	if a4 < 0:
		a4 = 0
	if a5 < 0:
		a5 = 0
	if c3 < a4 + a5:
		flag = 1
	if flag == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if c1 < a1 or c2 < a2 or c3 < a3:
		print('NO')
		continue
	else:
		if c1 - a1 >= a4:
			a4 = 0
		else:
			a4 = a4 - (c1 - a1)
		if c2 - a2 >= a5:
			a5 = 0
		else:
			a5 = a5 - (c2 - a2)
		c = a4 + a5
		c3 = c3 - a3
		if c3 >= c:
			print('YES')
		else:
			print('NO')


def know_ans(x, y, z, a1, a2, a3, first, second):
	if a1 > x or a2 > y or a3 > z or (x + y + z < a1 + a2 + a3 + first + second):
		return False
	x -= a1
	y -= a2
	z -= a3
	if x + y + z < first + second:
		return False
	first -= x
	second -= y
	if first <= 0 and second <= 0:
		return True
	if max(0, first) + max(0, second) > z:
		return False
	return True
t = int(input())
for i in range(t):
	(x, y, z) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if know_ans(x, y, z, a1, a2, a3, a4, a5):
		print('YES')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	(c1, c2, c3) = [int(i) for i in input().split()]
	(a1, a2, a3, a4, a5) = [int(i) for i in input().split()]
	w1 = c1
	w2 = c2
	w3 = c3
	w1 -= a1
	w2 -= a2
	w3 -= a3
	if w1 < 0 or w2 < 0 or w3 < 0:
		print('NO')
	else:
		a4 -= w1
		a5 -= w2
		a4 = max(0, a4)
		a5 = max(0, a5)
		if a4 + a5 <= w3:
			print('YES')
		else:
			print('NO')


import math

def ass(a, b):
	if a != b:
		print(f'Assertion error: {a} != {b}')
	else:
		print('OK')

def intline():
	return [int(item) for item in input().split()]

def line():
	return [item for item in input().split()]

def dump(lst):
	for (i, item) in enumerate(lst):
		print(i, item)

def binsearch(arr, a, b):
	m = (a + b) // 2
	if a >= b:
		return a - 1 if arr[a] == 0 else a
	return binsearch(arr, a, m - 1) if arr[m] == 0 else binsearch(arr, m + 1, b)

def f(max, arr):
	c = [0, 0, 0]
	if arr[0] <= max[0]:
		c[0] = arr[0]
	else:
		return 'NO'
	if arr[1] <= max[1]:
		c[1] = arr[1]
	else:
		return 'NO'
	if arr[2] <= max[2]:
		c[2] = arr[2]
	else:
		return 'NO'
	antal = min(arr[3], max[0] - c[0])
	if antal >= 0:
		c[0] += antal
		c[2] += arr[3] - antal
	antal = min(arr[4], max[1] - c[1])
	if antal >= 0:
		c[1] += antal
		c[2] += arr[4] - antal
	result = c[0] <= max[0] and c[1] <= max[1] and (c[2] <= max[2]) and (sum(c) == sum(arr))
	return 'YES' if result else 'NO'
t = intline()[0]
for i in range(t):
	max = intline()
	arr = intline()
	print(f(max, arr))


t = int(input())
for _ in range(t):
	(c1, c2, c3) = list(map(int, input().split()))
	(a1, a2, a3, a4, a5) = list(map(int, input().split()))
	if a1 > c1 or a2 > c2 or a3 > c3:
		print('NO')
	else:
		c1 -= a1
		c2 -= a2
		c3 -= a3
		if c1 + c3 < a4 or c2 + c3 < a5:
			print('NO')
		else:
			a4 -= c1
			a5 -= c2
			if c3 < a4 + a5:
				print('NO')
			else:
				print('YES')


for i in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if a1 > c1 or a2 > c2 or a3 > c3:
		print('NO')
	else:
		c1 = c1 - a1
		c2 = c2 - a2
		c3 = c3 - a3
		if c1 >= a4:
			c1 = c1 - a4
			a4 = 0
		else:
			a4 = a4 - c1
			if c3 >= a4:
				c3 = c3 - a4
				a4 = 0
			else:
				a4 = a4 - c3
		if c2 >= a5:
			c2 = c2 - a5
			a5 = 0
		else:
			a5 = a5 - c2
			if c3 >= a5:
				c3 = c3 - a5
				a5 = 0
			else:
				a5 = a5 - c3
		if a4 == 0 and a5 == 0:
			print('YES')
		else:
			print('NO')


t = int(input())
for i in range(t):
	c = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	for i in range(3):
		c[i] = c[i] - a[i]
	if c[0] < 0 or c[1] < 0 or c[2] < 0:
		print('NO')
		continue
	if c[0] >= a[3]:
		a[3] = 0
	else:
		a[3] = a[3] - c[0]
	if c[1] >= a[4]:
		a[4] = 0
	else:
		a[4] = a[4] - c[1]
	if a[3] + a[4] > c[2]:
		print('NO')
	else:
		print('YES')


def fun(c1, c2, c3, a1, a2, a3, a4, a5):
	if a1 > c1 or a2 > c2 or a3 > c3:
		return False
	c1 -= a1
	c2 -= a2
	c3 -= a3
	if c1 >= a4:
		c1 -= a4
	else:
		a4 -= c1
		if c3 >= a4:
			c3 -= a4
		else:
			return False
	if c2 >= a5:
		c2 -= a5
	else:
		a5 -= c2
		if c3 >= a5:
			c3 -= a5
		else:
			return False
	return True
t = int(input())
for _ in range(t):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if fun(c1, c2, c3, a1, a2, a3, a4, a5):
		print('YES')
	else:
		print('NO')


def possible_to_fit(c1, c2, c3, a1, a2, a3, a4, a5):
	if c1 < a1 or c2 < a2 or c3 < a3:
		return False
	c1 -= a1
	c2 -= a2
	c3 -= a3
	a4 = a4 - c1 if c1 < a4 else 0
	a5 = a5 - c2 if c2 < a5 else 0
	return c3 >= a4 + a5
t = int(input().strip())
for _ in range(t):
	(c1, c2, c3) = map(int, input().strip().split())
	(a1, a2, a3, a4, a5) = map(int, input().strip().split())
	if possible_to_fit(c1, c2, c3, a1, a2, a3, a4, a5):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	l = list(map(int, input().strip().split(' ')))
	(c1, c2, c3) = (l[0], l[1], l[2])
	l = list(map(int, input().strip().split(' ')))
	(a1, a2, a3, a4, a5) = (l[0], l[1], l[2], l[3], l[4])
	c1 -= a1
	c2 -= a2
	c3 -= a3
	if c1 >= 0:
		if c1 < a4:
			a4 -= c1
		else:
			a4 = 0
	if c2 >= 0:
		if c2 < a5:
			a5 -= c2
		else:
			a5 = 0
	c3 -= a4 + a5
	if c1 >= 0 and c2 >= 0 and (c3 >= 0):
		print('YES')
	else:
		print('NO')


from sys import stdin
T = int(stdin.readline())
for t in range(T):
	Cs = [int(x) for x in stdin.readline().split()]
	As = [int(x) for x in stdin.readline().split()]
	print('YES' if all((As[i] <= Cs[i] for i in range(3))) and max(0, As[3] - (Cs[0] - As[0])) + max(0, As[4] - (Cs[1] - As[1])) <= Cs[2] - As[2] else 'NO')


for _ in range(int(input())):
	(t1, t2, t3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	(t1, t2, t3) = (t1 - a1, t2 - a2, t3 - a3)
	if t1 >= 0 and t2 >= 0 and (t3 >= 0):
		if t1 - a4 >= 0:
			pass
		elif t1 - a4 < 0:
			t3 -= abs(t1 - a4)
		if t2 - a5 >= 0:
			pass
		elif t2 - a5 < 0:
			t3 -= abs(t2 - a5)
		if t3 >= 0:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


import sys
sys.setrecursionlimit(1000000)
from collections import defaultdict, deque, Counter
from itertools import permutations
from math import sqrt, gcd, pi, factorial
from functools import reduce
from sys import stdin
from bisect import bisect_right, bisect_left
from copy import copy

def solve(c1, c2, c3, a1, a2, a3, a4, a5):
	c1 -= a1
	c2 -= a2
	c3 -= a3
	if c1 < 0 or c2 < 0 or c3 < 0:
		return False
	a4 -= min(a4, c1)
	a5 -= min(a5, c2)
	return a4 + a5 <= c3
t = int(input())
anss = [False for _ in range(t)]
for i in range(t):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	anss[i] = solve(c1, c2, c3, a1, a2, a3, a4, a5)
for ans in anss:
	if ans:
		print('YES')
	else:
		print('NO')


try:
	test = int(input())
	while test != 0:
		(c1, c2, c3) = map(int, input().split())
		(a, b, c, pap, plas) = map(int, input().split())
		if a == c1 and b == c2 and (c == c3):
			if pap == 0 and plas == 0:
				print('Yes')
			else:
				print('No')
		elif a > c1 or b > c2 or c > c3:
			print('No')
		else:
			remain1 = c1 - a
			remain2 = c2 - b
			remain3 = c3 - c
			if pap <= remain1 and plas <= remain2 and (remain3 >= 0):
				print('Yes')
			elif pap >= remain1 and plas >= remain2:
				pap -= remain1
				plas -= remain2
				if pap == 0 and plas == 0:
					print('Yes')
				elif pap + plas <= remain3:
					print('Yes')
				else:
					print('No')
			else:
				if pap < remain1:
					pap = 0
				else:
					pap = pap - remain1
				if plas < remain2:
					plas = 0
				else:
					plas -= remain2
				if pap + plas <= remain3:
					print('Yes')
				else:
					print('No')
		test -= 1
except EOFError as e:
	print('')


from sys import exit, stderr, stdout
vector = lambda lim, fill: [fill for _ in range(lim)]

def debug(*args):
	for i in args:
		stderr.write(str(i) + ' ')
	stderr.write('\n')

class Input:

	def __init__(self):
		self.i = 0

	def inp(self, x):
		return x
for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	c = [c1, c2, c3]
	a = [int(x) for x in input().split()]
	fg = False
	for i in range(3):
		if a[i] > c[i]:
			print('NO')
			fg = True
			break
	if fg:
		continue
	if a[3]:
		ppw = min(c1 - a[0], a[3])
		a[0] += ppw
		a[3] -= ppw
	if a[4]:
		plw = min(c2 - a[1], a[4])
		a[1] += plw
		a[4] -= plw
	if sum(a[2:]) > c3:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	c = [int(i) for i in input().split()]
	arr = [int(i) for i in input().split()]
	r = 0
	for i in range(3):
		c[i] = c[i] - arr[i]
		if c[i] < 0:
			r = 1
			print('NO')
			break
	if r == 1:
		continue
	if c[0] + c[2] >= arr[3]:
		c[2] = c[2] - max(arr[3] - c[0], 0)
	else:
		print('NO')
		continue
	if c[1] + c[2] >= arr[4]:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	(c1, c2, c3) = list(map(int, input().split()))
	(a1, a2, a3, a4, a5) = list(map(int, input().split()))
	if c1 >= a1 and c2 >= a2 and (c3 >= a3) and (c1 + c3 >= a1 + a3 + a4) and (c2 + c3 >= a2 + a3 + a5) and (c1 + c2 + c3 >= a1 + a2 + a3 + a4 + a5):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	lis1 = list(map(int, input().split()))
	lis2 = list(map(int, input().split()))
	if sum(lis2) > sum(lis1) or lis1[0] < lis2[0] or lis1[1] < lis2[1] or (lis1[2] < lis2[2]):
		print('No')
	elif lis1[0] + lis1[2] < lis2[0] + lis2[3] + lis2[2] or lis1[1] + lis1[2] < lis2[1] + lis2[4] + lis2[2]:
		print('no')
	else:
		print('yes')


def check(c1, c2, c3, v13, v23):
	if c1 < 0 or c2 < 0 or c3 < 0:
		return False
	v13 -= min(v13, c1)
	v23 -= min(v23, c2)
	return v13 + v23 <= c3
for i in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	c1 -= a1
	c2 -= a2
	c3 -= a3
	if check(c1, c2, c3, a4, a5):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if a1 > c1 or a2 > c2 or a3 > c3:
		print('NO')
		continue
	c1_space = c1 - a1
	c2_space = c2 - a2
	c3_space = c3 - a3
	if c1_space + c3_space >= a4:
		if c1_space >= a4:
			c3_left = c3_space
		else:
			c3_left = c3_space - (a4 - c1_space)
	else:
		print('NO')
		continue
	if c3_left + c2_space >= a5:
		print('YES')
	else:
		print('NO')


for w in range(int(input())):
	(c1, c2, c3) = tuple(map(int, input().split()))
	(a1, a2, a3, a4, a5) = tuple(map(int, input().split()))
	x1 = 0
	x2 = 0
	x3 = 0
	ans = 0
	correct = 0
	if a1 <= c1:
		x1 += a1
	else:
		correct = 1
	if a2 <= c2:
		x2 += a2
	else:
		correct = 1
	if a3 <= c3:
		x3 += a3
	else:
		correct = 1
	a4 -= min(c1 - x1, a4)
	x1 += c1 - x1
	a5 -= min(c2 - x2, a5)
	x2 += c2 - x2
	if a5 + a4 + x3 > c3:
		correct = 1
	if correct == 1:
		print('NO')
	else:
		print('YES')


def calc(a, b, c, m):
	if m[0] <= a:
		r1 = a - m[0]
	else:
		print('NO')
		return 0
	if m[1] <= b:
		r2 = b - m[1]
	else:
		print('NO')
		return 0
	if m[2] <= c:
		r3 = c - m[2]
	else:
		print('NO')
		return 0
	if m[3] <= r1:
		r4 = 0
	elif m[3] > r1:
		r4 = m[3] - r1
	if m[4] <= r2:
		r5 = 0
	elif m[4] > r2:
		r5 = m[4] - r2
	if r4 + r5 <= r3:
		print('YES')
	else:
		print('NO')
	pass
t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	m = list(map(int, input().split()))
	calc(a, b, c, m)


for i in range(int(input())):
	(b1, b2, b3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	b1 -= a1
	b2 -= a2
	b3 -= a3
	if b1 < 0 or b2 < 0 or b3 < 0:
		print('NO')
		continue
	if b1 >= a4:
		b1 -= a4
		a4 = 0
	else:
		a4 -= b1
		b1 = 0
	if b2 >= a5:
		b2 -= a5
		a5 = 0
	else:
		a5 -= b2
		b2 = 0
	b3 = b3 - a5 - a4
	if b1 < 0 or b2 < 0 or b3 < 0:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	c = list(map(int, input().split()))
	l = list(map(int, input().split()))
	if c[0] >= l[0] and c[1] >= l[1] and (c[0] - l[0] + c[1] - l[1] + abs(l[2] - c[2]) >= l[-1] + l[-2]):
		if max(0, l[-2] - (c[0] - l[0])) + max(0, l[-1] - (c[1] - l[1])) <= c[2] - l[2]:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


for _ in range(int(input())):
	cap = list(map(int, input().split()))
	val = list(map(int, input().split()))
	sig = 0
	for i in range(3):
		if cap[i] < val[i]:
			print('NO')
			sig = 1
			break
	if sig == 1:
		continue
	r1 = cap[0] - val[0]
	r2 = cap[1] - val[1]
	r1 = val[3] - r1
	r2 = val[4] - r2
	if r1 < 0:
		r1 = 0
	if r2 < 0:
		r2 = 0
	if cap[2] - val[2] - (r1 + r2) < 0:
		print('NO')
		continue
	print('YES')


n = int(input())
for j in range(0, n):
	(a, b, c) = map(int, input().split())
	(x, y, z, w, u) = map(int, input().split())
	c = c - z
	a = a - x
	b = b - y
	if a < w:
		c = c - (w - a)
	if b < u:
		c = c - (u - b)
	if a >= 0 and b >= 0 and (c >= 0):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	c = list(map(int, input().rstrip().rsplit()))
	a = list(map(int, input().rstrip().rsplit()))
	(c1, c2, c3, a1, a2, a3, a4, a5, a41, a51, a42, a52) = (c[0], c[1], c[2], a[0], a[1], a[2], a[3], a[4], 0, 0, 0, 0)
	if a4 + a1 > c1:
		a42 = a1 + a4 - c1
		a41 = a4 - a42
	else:
		a41 = a4
	if a5 + a2 > c2:
		a52 = a2 + a5 - c2
		a51 = a5 - a52
	else:
		a51 = a5
	(A1, A2, A3) = (a1 + a41, a2 + a51, a3 + a42 + a52)
	if A1 <= c1 and A2 <= c2 and (A3 <= c3) and (a1 <= c1) and (a2 <= c2) and (a3 <= c3):
		print('Yes')
	else:
		print('No')


for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if a1 > c1 or a2 > c2 or a3 > c3:
		print('NO')
	else:
		d1 = c1 - a1
		d2 = c2 - a2
		d3 = c3 - a3
		if d1 > 0:
			if d1 > a4:
				a4 = 0
			else:
				a4 = a4 - d1
		if d2 > 0:
			if d2 > a5:
				a5 = 0
			else:
				a5 = a5 - d2
		if d3 >= a4 + a5:
			print('YES')
		else:
			print('NO')


t = int(input())
for i in range(t):
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	c[0] -= a[0]
	c[1] -= a[1]
	c[2] -= a[2]
	if min(c) < 0:
		print('no')
		continue
	if sum(c) < a[3] + a[4]:
		print('no')
		continue
	if c[0] < a[3]:
		a[3] -= c[0]
		c[0] = 0
	else:
		c[0] -= a[3]
		a[3] = 0
	if c[1] < a[4]:
		a[4] -= c[1]
		c[1] = 0
	else:
		c[1] -= a[4]
		a[4] = 0
	if a[3] + a[4] > c[2]:
		print('no')
	else:
		print('yes')


k = []
for _ in [0] * int(input()):
	(c1, c2, c3) = map(int, input().split())
	(a, b, c, d, e) = map(int, input().split())
	c1 -= a
	c2 -= b
	c3 -= c
	if c1 < 0 or c2 < 0:
		k.append('NO')
		continue
	s = min(c1, d)
	c3 -= d - s
	t = min(c2, e)
	c3 -= e - t
	if c3 >= 0:
		k.append('YES')
	else:
		k.append('NO')
print('\n'.join(k))


import math
import sys

class Read:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

def solve():
	c = Read.list_int()
	a = Read.list_int()
	res = 'NO'
	if a[0] <= c[0] and a[1] <= c[1] and (a[2] <= c[2]) and (sum(a) <= sum(c)):
		ost1 = 0
		ost2 = 0
		if c[0] < a[3] + a[0]:
			ost1 = a[3] + a[0] - c[0]
		if c[1] < a[4] + a[1]:
			ost2 = a[4] + a[1] - c[1]
		if c[2] >= a[2] + ost1 + ost2:
			res = 'YES'
	print(res)
query_count = Read.int()
while query_count:
	query_count -= 1
	solve()


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

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

def fi():
	return float(input())

def si():
	return input()

def msi():
	return map(str, input().split())

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

def li():
	return list(mi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)
mod = 1000000007

def modInverse(b, m):
	g = gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def modu(a, b, m):
	a = a % m
	inv = modInverse(b, m)
	if inv == -1:
		return -999999999
	else:
		return inv * a % m
from math import log, factorial, cos, tan, sin, radians, floor
import bisect
from decimal import *
getcontext().prec = 8
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def gcd1(a):
	if len(a) == 1:
		return a[0]
	ans = a[0]
	for i in range(1, len(a)):
		ans = gcd(ans, a[i])
	return ans

def main():
	for _ in range(ii()):
		c = li()
		a = li()
		(e, f) = (a[3], a[4])
		x = c[0] - a[0]
		y = c[1] - a[1]
		z = c[2] - a[2]
		g = max(0, e - x)
		h = max(0, f - y)
		if x >= 0 and y >= 0 and (z >= 0) and (g + h <= z):
			print('YES')
		else:
			print('NO')
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))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


T = int(input())
for t in range(0, T):
	string1 = list(map(int, input().split(' ')))
	c1 = string1[0]
	c2 = string1[1]
	c3 = string1[2]
	string2 = list(map(int, input().split(' ')))
	a1 = string2[0]
	a2 = string2[1]
	a3 = string2[2]
	a4 = string2[3]
	a5 = string2[4]
	p1 = a1 + a4 - c1
	p2 = a2 + a5 - c2
	p3 = c3 - a3
	if a1 > c1:
		print('NO')
	elif a2 > c2:
		print('NO')
	elif a3 > c3:
		print('NO')
	elif p1 < 0:
		if p2 <= p3:
			print('YES')
		else:
			print('NO')
	elif p2 < 0:
		if p1 <= p3:
			print('YES')
		else:
			print('NO')
	elif p3 < 0:
		print('NO')
	elif p1 + p2 <= p3:
		print('YES')
	else:
		print('NO')


from sys import stdin
inp = stdin.readlines()[1:]

def inputCleaner(line1, line2):
	rl1 = list(map(int, line1.strip().split()))
	rl2 = list(map(int, line2.strip().split()))
	return (rl1, rl2)

def legitThingy(line1, line2):
	(c1, c2, c3) = line1
	(a1, a2, a3, a4, a5) = line2
	c1 -= a1
	c2 -= a2
	c3 -= a3
	if c1 < 0 or c2 < 0 or c3 < 0:
		return False
	if c1 > a4:
		c1 -= a4
		a4 = 0
	elif c1 == a4:
		(c1, a4) = (0, 0)
	else:
		a4 -= c1
		c1 = 0
		if a4 > c3:
			return False
		elif a4 == c3:
			a4 = 0
			c3 = 0
		else:
			c3 -= a4
			a4 = 0
	if c2 >= a5:
		return True
	else:
		a5 -= c2
		if a5 > c3:
			return False
		else:
			return True
for i in range(int(len(inp) / 2)):
	(l1, l2) = inputCleaner(inp[i * 2], inp[i * 2 + 1])
	if legitThingy(l1, l2):
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(0, t):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	b = True
	c1 = c1 - a1
	c2 = c2 - a2
	c3 = c3 - a3
	if c1 < 0 or c2 < 0 or c3 < 0:
		b = False
	a4 = a4 - c1
	a5 = a5 - c2
	if a4 < 0:
		a4 = 0
	if a5 < 0:
		a5 = 0
	if b:
		if c3 >= a4 + a5:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


T = int(input())
for _ in range(T):
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if a[0] > c[0] or a[1] > c[1] or a[2] > c[2]:
		print('NO')
	else:
		a[3] = max(a[3] - c[0] + a[0], 0)
		a[4] = max(a[4] - c[1] + a[1], 0)
		if a[2] + a[3] + a[4] <= c[2]:
			print('YES')
		else:
			print('NO')


test_cases = int(input())
cases = []
for i in range(test_cases):
	c = list(map(int, input().strip().split()))
	a = list(map(int, input().strip().split()))
	cases.append((c, a))
for (c, a) in cases:
	b0 = a[0] - c[0]
	b1 = a[1] - c[1]
	b3 = max(a[3] + b0, 0)
	b4 = max(a[4] + b1, 0)
	t = a[2] + b3 + b4 - c[2]
	if b0 <= 0 and b1 <= 0 and (t <= 0):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if c1 < a1 or c2 < a2 or c3 < a3:
		print('no')
		continue
	else:
		c1 -= a1
		c2 -= a2
		c3 -= a3
		a4 -= min(a4, c1)
		a5 -= min(a5, c2)
	if c3 >= a4 + a5:
		print('yes')
	else:
		print('no')


from sys import stdout, stdin
input = stdin.readline
print = stdout.write

def main():
	mp = lambda : map(int, input().strip().split())
	it = int
	t = it(input())
	for _ in [0] * t:
		(c1, c2, c3) = mp()
		(a1, a2, a3, a4, a5) = mp()
		c1 -= a1
		c2 -= a2
		c3 -= a3
		if c1 < 0 or c2 < 0 or c3 < 0:
			print('no\n')
			continue
		c1 -= a4
		if c1 < 0:
			c3 += c1
			c1 = 0
		c2 -= a5
		if c2 < 0:
			c3 += c2
			c2 = 0
		if c1 < 0 or c2 < 0 or c3 < 0:
			print('no')
		else:
			print('yes')
		print('\n')
main()


t = int(input())
for i in range(t):
	(arr, brr) = (input().split(), input().split())
	(arr, brr) = (list(map(int, arr)), list(map(int, brr)))
	flag = 0
	if brr[0] > arr[0] or brr[1] > arr[1] or brr[2] > arr[2]:
		flag = 1
	else:
		arr[0] -= brr[0]
		arr[1] -= brr[1]
		arr[2] -= brr[2]
		if arr[0] + arr[2] < brr[3]:
			flag = 1
		else:
			arr[0] -= brr[3]
		if arr[0] < 0:
			arr[2] += arr[0]
		if arr[1] + arr[2] < brr[4]:
			flag = 1
	print('NO') if flag else print('YES')


cases = int(input())
outs = []
for i in range(cases):
	bin_spc = [int(n) for n in input().split()]
	waste = [int(n) for n in input().split()]
	for (bin, count) in enumerate(waste):
		try:
			bin_spc[bin] -= count
		except IndexError:
			cur = bin - 3
			if bin_spc[cur] >= 0:
				if count < bin_spc[cur]:
					bin_spc[cur] -= count
				else:
					rem = count - bin_spc[cur]
					bin_spc[cur] = 0
					bin_spc[2] -= rem
			else:
				pass
	fittable = True
	for (bin, items) in enumerate(bin_spc):
		if items < 0:
			fittable = False
			break
	if fittable:
		outs.append('YES')
	else:
		outs.append('NO')
for output in outs:
	print(output)


for _ in ' ' * int(input()):
	(c1, c2, c3) = list(map(int, input().split()))
	(a1, a2, a3, a4, a5) = list(map(int, input().split()))
	print(['NO', 'YES'][c1 >= a1 and c2 >= a2 and (c3 >= a3) and (c1 + c3 - a3 >= a1 + a4) and (c2 + c3 - a3 >= a2 + a5) and (c1 + c2 + c3 >= a1 + a2 + a3 + a4 + a5)])


t = int(input())
while t:
	c = list(map(int, input().split()))
	arr = list(map(int, input().split()))
	d1 = 0
	d2 = 0
	d3 = 0
	if c[0] < arr[0] or c[1] < arr[1] or c[2] < arr[2]:
		print('NO')
	else:
		if arr[3] > 0:
			d1 = c[0] - arr[0]
			if d1 >= arr[3]:
				arr[0] += arr[3]
				arr[3] = 0
			else:
				arr[0] = c[0]
				arr[3] -= d1
		if arr[4] > 0:
			d2 = c[1] - arr[1]
			if d2 >= arr[4]:
				arr[1] += arr[4]
				arr[4] = 0
			else:
				arr[1] += d2
				arr[4] -= d2
		arr[2] += arr[3] + arr[4]
		if arr[0] <= c[0] and arr[1] <= c[1] and (arr[2] <= c[2]):
			print('YES')
		else:
			print('NO')
	t -= 1


import os, sys
from collections import defaultdict, Counter, deque
from io import BytesIO, IOBase
from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)
import math as mt
MAXN = 100001
spf = [0 for i in range(MAXN)]

def getFactorization(x):
	ret = list()
	while x != 1:
		ret.append(spf[x])
		x = x // spf[x]
	return ret
import math

def smaa(a, b):
	x = 1
	for i in range(2, int(math.sqrt(b)) + 1, 2):
		if a % i == b % i == 0:
			x *= i
	return x

def main():
	for i in range(int(input())):
		c = [int(x) for x in input().split()]
		a = [int(x) for x in input().split()]
		c[0] -= a[0]
		c[1] -= a[1]
		c[2] -= a[2]
		p = 0
		for i in c:
			if i < 0:
				print('NO')
				p = 1
				break
		if not p:
			a[3] = max(a[3] - c[0], 0)
			a[4] = max(a[4] - c[1], 0)
			if a[3] < 0 or a[4] < 0:
				print('YES')
			elif a[3] + a[4] > c[2]:
				print('NO')
			else:
				print('YES')
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')
main()


t = int(input())
while t > 0:
	(c1, c2, c3) = [int(_) for _ in input().split(' ')]
	(a1, a2, a3, a4, a5) = [int(_) for _ in input().split(' ')]
	if c1 >= a1 and c2 >= a2 and (c3 >= a3):
		c1 -= a1
		c2 -= a2
		c3 -= a3
		left = 0
		if c1 < a4:
			left += a4 - c1
		if c2 < a5:
			left += a5 - c2
		if left <= c3:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
	t -= 1


import sys
input = sys.stdin.buffer.readline

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))
t = int(input())
allAns = []
for _ in range(t):
	(x, y, z) = [int(zz) for zz in input().split()]
	(a, b, c, d, e) = [int(x) for x in input().split()]
	purePaper = min(a, x)
	a -= purePaper
	x -= purePaper
	purePlastic = min(b, y)
	b -= purePlastic
	y -= purePlastic
	neither = min(c, z)
	c -= neither
	z -= neither
	partialPaper1 = min(x, d)
	x -= partialPaper1
	d -= partialPaper1
	partialPaper2 = min(z, d)
	z -= partialPaper2
	d -= partialPaper2
	partialPlastic1 = min(y, e)
	y -= partialPlastic1
	e -= partialPlastic1
	partialPlastic2 = min(z, e)
	z -= partialPlastic2
	e -= partialPlastic2
	if a == b == c == d == e == 0:
		ans = 'YES'
	else:
		ans = 'NO'
	allAns.append(ans)
multiLineArrayPrint(allAns)


def main():
	t = int(input())
	for i in range(t):
		line = input().split()
		c1 = int(line[0])
		c2 = int(line[1])
		c3 = int(line[2])
		line = input().split()
		a1 = int(line[0])
		a2 = int(line[1])
		a3 = int(line[2])
		a4 = int(line[3])
		a5 = int(line[4])
		if a1 > c1 or a2 > c2 or a3 > c3:
			print('NO')
		else:
			c1 -= a1
			c2 -= a2
			c3 -= a3
			if c1 >= a4:
				left_c4 = 0
			else:
				left_c4 = a4 - c1
			if c2 >= a5:
				left_c5 = 0
			else:
				left_c5 = a5 - c2
			if left_c4 + left_c5 <= c3:
				print('YES')
			else:
				print('NO')
main()


t = int(input())
res = []
for s in range(t):
	arr = [int(i) for i in input().split()]
	c1 = arr[0]
	c2 = arr[1]
	c3 = arr[2]
	arr = [int(i) for i in input().split()]
	a1 = arr[0]
	a2 = arr[1]
	a3 = arr[2]
	a4 = arr[3]
	a5 = arr[4]
	if a1 > c1 or a2 > c2 or a3 > c3:
		res.append('NO')
	else:
		c1 = c1 - a1
		c2 = c2 - a2
		c3 = c3 - a3
		if a4 > c1 + c3 or a5 > c2 + c3:
			res.append('NO')
		else:
			a4 = a4 - c1
			a5 = a5 - c2
			if a4 + a5 > c3:
				res.append('NO')
			else:
				res.append('YES')
for i in res:
	print(i)


for _ in range(int(input())):
	(x, y, z) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	x -= a1
	y -= a2
	z -= a3
	if x < 0 or y < 0 or z < 0:
		print('No')
		continue
	if x >= a4:
		x = x - a4
		a4 = 0
	else:
		a4 = a4 - x
		x = 0
	if z >= a4:
		z = z - a4
		a4 = 0
	else:
		a4 = a4 - z
		z = 0
	if y >= a5:
		y = y - a5
		a5 = 0
	else:
		a5 = a5 - y
		x = 0
	if z >= a5:
		z = z - a5
		a5 = 0
	else:
		a5 = a5 - z
		z = 0
	if a4 == 0 and a5 == 0:
		print('Yes')
	else:
		print('No')


t = int(input())
for i in range(t):
	(c1, c2, c3) = map(int, input().split(' '))
	(a1, a2, a3, a4, a5) = map(int, input().split(' '))
	c_1 = c1 - a1
	c_2 = c2 - a2
	c_3 = c3 - a3
	k4 = a4 - c_1
	k5 = a5 - c_2
	if c_1 >= 0 and c_2 >= 0 and (c_3 >= 0):
		if k4 <= 0:
			k4 = 0
		if k5 <= 0:
			k5 = 0
		if c_3 - (k4 + k5) >= 0:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


def solve(c, a):
	for i in range(1, 4):
		c[i] -= a[i]
	not_enough_room_for_pure_items = min(c) < 0
	if not_enough_room_for_pure_items:
		return False
	c[1] -= a[4]
	c[2] -= a[5]
	if c[1] < 0:
		c[3] -= -c[1]
	if c[2] < 0:
		c[3] -= -c[2]
	return c[3] >= 0
cases = int(input())
for case in range(cases):
	c = [0]
	a = [0]
	for t in input().split():
		c.append(int(t))
	for t in input().split():
		a.append(int(t))
	print('YES' if solve(c, a) else 'NO')


for _ in range(int(input())):
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))

	def check(c, a, i):
		if i < 3:
			if c[i] < a[i]:
				return (False, c)
			else:
				c[i] -= a[i]
				return (True, c)
		else:
			a[3] -= c[0]
			a[4] -= c[1]
			if a[3] > c[2] or a[4] > c[2] or a[3] + a[4] > c[2]:
				return (False, c)
			else:
				return (True, c)
	flag = True
	if sum(c) < sum(a):
		print('No')
		continue
	else:
		for i in range(len(a) - 1):
			(flag, c) = check(c, a, i)
			if not flag:
				break
		if flag:
			print('Yes')
		else:
			print('No')


t = int(input())
for t in range(0, t):
	(c1, c2, c3) = list(map(int, input().rstrip().split()))
	(a, b, c, d, e) = list(map(int, input().rstrip().split()))
	if a > c1 or b > c2 or c > c3:
		print('NO')
	else:
		c1 = c1 - a
		c2 = c2 - b
		c3 = c3 - c
		if d <= c1 or d - c1 <= c3:
			if d > c1:
				c3 = c3 - d + c1
			if e <= c3 + c2:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')


for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	c1 -= a1
	c2 -= a2
	c3 -= a3
	if c1 < 0 or c2 < 0 or c3 < 0:
		print('NO')
	else:
		x = min(a4, c1)
		y = min(a5, c2)
		a4 -= x
		c1 -= x
		a5 -= y
		c2 -= y
		if a4 + a5 <= c3:
			print('YES')
		else:
			print('NO')


for i in range(int(input())):
	(x, y, z) = list(map(int, input().split()))
	(a, b, c, d, e) = list(map(int, input().split()))
	if x >= a and z >= c and (y >= b):
		if a + d + c <= x + z and b + c + e <= y + z and (a + b + c + d + e <= x + y + z):
			print('YES')
		else:
			print('NO')
	else:
		print('NO')


def solve():
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	f = 1
	c1 = c1 - a1
	c2 = c2 - a2
	c3 = c3 - a3
	if c1 < 0 or c2 < 0 or c3 < 0:
		f = 0
	if a4 > 0:
		m1 = min(c1, a4)
		a4 = a4 - m1
		c1 = c1 - m1
		if a4 > 0:
			m11 = min(a4, c3)
			a4 = a4 - m11
			c3 = c3 - m11
			if a4 > 0:
				f = 0
	if a5 > 0:
		m2 = min(c2, a5)
		a5 = a5 - m2
		c2 = c2 - m2
		if a5 > 0:
			m22 = min(a5, c3)
			a5 = a5 - m22
			c3 = c3 - m22
			if a5 > 0:
				f = 0
	if f == 0:
		print('NO')
	else:
		print('YES')
for testis in range(int(input())):
	solve()


n = int(input())
listtu = []
for i in range(n):
	(c1, c2, c3) = map(int, input().split(' '))
	(a1, a2, a3, a4, a5) = map(int, input().split(' '))
	c1 = c1 - a1
	c2 = c2 - a2
	c3 = c3 - a3
	a4 = a4 - c1
	a5 = a5 - c2
	if max(a4, 0) + max(a5, 0) <= c3 and c1 >= 0 and (c2 >= 0) and (c3 >= 0):
		listtu.append('Yes')
	else:
		listtu.append('No')
for i in listtu:
	print(i)


t = int(input())
while t:
	t -= 1
	(a, b, c) = map(int, input().split())
	(a1, b1, c1, d, e) = map(int, input().split())
	if a1 > a or b1 > b or c1 > c:
		print('NO')
	else:
		f = 0
		a -= a1
		b -= b1
		c -= c1
		if d > a:
			d -= a
		else:
			d = 0
		if e > b:
			e -= b
		else:
			e = 0
		if d + e > c:
			print('NO')
		else:
			print('YES')


def solve():
	for i in range(3):
		if a[i] <= c[i]:
			c[i] -= a[i]
		else:
			return str('NO')
	else:
		if c[0] < a[3]:
			a[3] -= c[0]
			if c[2] < a[3]:
				return str('NO')
			else:
				c[2] -= a[3]
		if c[1] < a[4]:
			a[4] -= c[1]
			if c[2] < a[4]:
				return str('NO')
	return str('YES')
for t in range(int(input())):
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	print(solve())


import sys
for _ in range(int(sys.stdin.readline().strip())):
	c = list(map(int, sys.stdin.readline().strip().split(' ')))
	a = list(map(int, sys.stdin.readline().strip().split(' ')))
	saab = True
	for i in range(len(c)):
		c[i] -= a[i]
	for i in c:
		if i < 0:
			saab = False
			break
	if a[3] > c[0]:
		a[3] -= c[0]
		c[2] -= a[3]
	if a[4] > c[1]:
		a[4] -= c[1]
		c[2] -= a[4]
	if c[2] < 0:
		saab = False
	if saab:
		print('YES')
	else:
		print('No')


for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	rem1 = c1 - a1
	rem2 = c2 - a2
	rem3 = c3 - a3
	if c1 < a1 or c2 < a2 or c3 < a3:
		print('NO')
		continue
	if rem1 >= 0 and rem2 >= 0 and (rem3 >= 0):
		rem1 -= a4
		rem2 -= a5
		if rem1 < 0:
			rem3 += rem1
		if rem2 < 0 and rem3 >= 0:
			rem3 += rem2
	if rem3 >= 0:
		print('YES')
	if rem3 < 0:
		print('NO')


t = int(input())
for i in range(t):
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = [0] * 3
	for j in range(3):
		if b[j] > a[j]:
			ans = 'NO'
			break
		else:
			c[j] = a[j] - b[j]
			if j == 2:
				if b[3] <= c[0]:
					if b[4] - c[1] <= c[2]:
						ans = 'YES'
					else:
						ans = 'NO'
				elif b[4] <= c[1]:
					if b[3] - c[0] <= c[2]:
						ans = 'YES'
					else:
						ans = 'NO'
				elif b[3] - c[0] + b[4] - c[1] <= c[2]:
					ans = 'YES'
				else:
					ans = 'NO'
	print(ans)


t = int(input())
for i in range(t):
	c = list(map(int, input().rstrip().split()))
	c1 = c[0]
	c2 = c[1]
	c3 = c[2]
	a = list(map(int, input().rstrip().split()))
	(a1, a2, a3, a4, a5) = (a[0], a[1], a[2], a[3], a[4])
	b1 = c1 - a1
	b2 = c2 - a2
	b3 = c3 - a3
	if sum(c) < sum(a) or a1 > c1 or a2 > c2 or (a3 > c3):
		print('NO')
	elif b2 + b3 < a5 or b1 + b3 < a4 or b1 + b2 + b3 < a4 + a5:
		print('NO')
	else:
		print('YES')


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	(c1, c2, c3) = map(int, stdin.readline().split())
	(a1, a2, a3, a4, a5) = map(int, stdin.readline().split())
	if a1 > c1 or a2 > c2 or a3 > c3:
		print('no')
	elif max(a4 - (c1 - a1), 0) + max(a5 - (c2 - a2), 0) + a3 > c3:
		print('no')
	else:
		print('yes')


for tests in range(int(input())):
	(a, b) = ([int(s) for s in input().split()], [int(s) for s in input().split()])
	print('NO') if a[0] < b[0] or a[1] < b[1] or a[2] < b[2] or (a[1] + a[2] < b[1] + b[2] + b[4]) or (a[0] + a[2] < b[0] + b[2] + b[3]) or (sum(a) < sum(b)) else print('YES')


def solve():
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if c[0] < a[0] or c[1] < a[1] or c[2] < a[2]:
		return False
	c[0] -= a[0]
	c[1] -= a[1]
	c[2] -= a[2]
	a[3] = max(a[3] - c[0], 0)
	a[4] = max(a[4] - c[1], 0)
	return a[3] + a[4] <= c[2]
n = int(input())
for _ in range(n):
	print('yes' if solve() else 'no')


def f(c1, c2, c3, a1, a2, a3, a4, a5):
	c1 = c1 - a1
	c2 = c2 - a2
	c3 = c3 - a3
	if c3 >= 0 and c2 >= 0 and (c1 >= 0):
		a4 = a4 - c1
		if a4 > 0:
			c3 = c3 - a4
			if c3 < 0:
				return 'NO'
		a5 = a5 - c2
		if a5 > 0:
			c3 = c3 - a5
			if c3 < 0:
				return 'NO'
		return 'YES'
	else:
		return 'NO'
for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	print(f(c1, c2, c3, a1, a2, a3, a4, a5))


def Func(capacities, wastes):
	c = [0] * 3
	if wastes[0] <= capacities[0]:
		c[0] = wastes[0]
	else:
		return False
	if wastes[1] <= capacities[1]:
		c[1] = wastes[1]
	else:
		return False
	if wastes[2] <= capacities[2]:
		c[2] = wastes[2]
	else:
		return False
	if c[0] + wastes[3] <= capacities[0]:
		c[0] += wastes[3]
		wastes[3] = 0
	else:
		temp4 = capacities[0] - c[0]
		c[0] += temp4
		wastes[3] -= temp4
	if c[1] + wastes[4] <= capacities[1]:
		c[1] += wastes[4]
		wastes[4] = 0
	else:
		temp5 = capacities[1] - c[1]
		c[1] += temp5
		wastes[4] -= temp5
	if wastes[3] + wastes[4] <= capacities[2] - c[2]:
		return True
	else:
		return False
t = int(input())
for _ in range(t):
	capacities = list(map(int, input().split()))
	wastes = list(map(int, input().split()))
	if Func(capacities, wastes):
		print('YES')
	else:
		print('NO')


for _ in range(0, int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	f = c1 - a1 >= 0
	a3 += max(0, a4 - max(0, c1 - a1))
	f &= c2 - a2 >= 0
	a3 += max(0, a5 - max(0, c2 - a2))
	print(['NO', 'YES'][f and c3 >= a3])


t = int(input())
for i in range(t):
	l = list(map(int, input().strip().split()))
	waste = list(map(int, input().strip().split()))
	if waste[0] > l[0] or waste[1] > l[1]:
		print('NO')
		continue
	s = s1 = 0
	s = l[0] - waste[0]
	s1 = l[1] - waste[1]
	waste[3] -= s
	waste[4] -= s1
	waste = [0 if i < 0 else i for i in waste]
	if waste[3] + waste[4] + waste[2] <= l[2]:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	a = list(map(int, input().split()))
	l = list(map(int, input().split()))
	if a[0] >= l[0] and a[1] >= l[1] and (a[2] >= l[2]) and (a[0] + a[2] >= l[0] + l[2] + l[3]) and (a[1] + a[2] >= l[1] + l[2] + l[4]) and (sum(a) >= sum(l)):
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(0, t):
	inputs1 = [int(num) for num in input().split()]
	c1 = inputs1[0]
	c2 = inputs1[1]
	c3 = inputs1[2]
	inputs2 = [int(num) for num in input().split()]
	a1 = inputs2[0]
	a2 = inputs2[1]
	a3 = inputs2[2]
	a4 = inputs2[3]
	a5 = inputs2[4]
	c1 = c1 - a1
	c2 = c2 - a2
	c3 = c3 - a3
	flag = 0
	if c1 >= 0 and c2 >= 0 and (c3 >= 0):
		if c1 >= a4:
			c1 -= a4
		else:
			a4 -= c1
			c1 = 0
			if c3 >= a4:
				c3 -= a4
			else:
				flag = 1
		if c2 >= a5:
			c2 -= a5
		else:
			a5 -= c2
			c2 = 0
			if c3 >= a5:
				c3 -= a5
			else:
				flag = 1
	else:
		flag = 1
	if flag == 0:
		print('YES')
	else:
		print('NO')


import re
import sys
exit = sys.exit
from bisect import bisect_left as bsl, bisect_right as bsr
from collections import Counter, defaultdict as ddict, deque
from functools import lru_cache
cache = lru_cache(None)
from heapq import *
from itertools import *
from math import inf
from pprint import pprint as pp
enum = enumerate
ri = lambda : int(rln())
ris = lambda : list(map(int, rfs()))
rln = sys.stdin.readline
rl = lambda : rln().rstrip('\n')
rfs = lambda : rln().split()
d4 = [(0, -1), (1, 0), (0, 1), (-1, 0)]
d8 = [(-1, -1), (0, -1), (1, -1), (-1, 0), (1, 0), (-1, 1), (0, 1), (1, 1)]
t = ri()
for _ in range(t):
	c = ris()
	a = ris()
	ok = 1
	for (i, x) in enum(a):
		if i < 3:
			c[i] -= x
		elif i == 3:
			k = min(x, c[0])
			x -= k
			c[0] -= k
			c[2] -= x
		elif i == 4:
			k = min(x, c[1])
			x -= k
			c[1] -= k
			c[2] -= x
		for x in c:
			if x < 0:
				ok = 0
				break
	if ok:
		print('YES')
	else:
		print('NO')


def solve():
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	for i in range(3):
		if a[i] > c[i]:
			print('NO')
			return
		c[i] -= a[i]
	to_c1 = min(c[0], a[3])
	c[0] -= to_c1
	a[3] -= to_c1
	to_c2 = min(c[1], a[4])
	c[1] -= to_c2
	a[4] -= to_c2
	if a[3] + a[4] > c[2]:
		print('NO')
		return
	print('YES')
for _ in range(int(input())):
	solve()


def function():
	res = []
	n = int(input())
	for _ in range(n):
		fill = [int(e) for e in input().split(' ')]
		testcase = [int(e) for e in input().split(' ')]
		if sum(fill) == 0 and sum(testcase) == 0:
			res.append('YES')
			continue
		if testcase[0] > fill[0] or testcase[1] > fill[1] or testcase[2] > fill[2]:
			res.append('NO')
			continue
		fourtothree = max([0, testcase[3] - (fill[0] - testcase[0])])
		fivetothree = max([0, testcase[4] - (fill[1] - testcase[1])])
		if testcase[2] + sum([fourtothree, fivetothree]) > fill[2]:
			res.append('NO')
			continue
		res.append('YES')
	return res
[print(e) for e in function()]


t = int(input())
for i in range(t):
	(c1, c2, c3) = map(int, input().split(' '))
	(a1, a2, a3, a4, a5) = map(int, input().split(' '))
	e1 = c1 - a1
	e2 = c2 - a2
	e3 = c3 - a3
	if e1 >= 0 and e2 >= 0 and (e3 >= 0) and (e1 + e3 >= a4) and (e2 + e3 >= a5) and (e3 - (a4 - e1) >= a5 - e2):
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	bins = list(map(int, input().split()))
	values = list(map(int, input().split()))
	paper = bins[0] - values[0]
	plastic = bins[1] - values[1]
	other = bins[2] - values[2]
	if paper < 0 or plastic < 0 or other < 0:
		print('NO')
	elif values[3] > paper + other or values[4] > plastic + other or values[3] + values[4] > paper + plastic + other:
		print('NO')
	else:
		print('YES')


import math
IP = lambda : list(map(int, input().split()))
for i in range(int(input())):
	(a, b, c) = IP()
	lst = IP()
	a = a - lst[0]
	b = b - lst[1]
	c = c - lst[2]
	if a < 0 or b < 0 or c < 0:
		print('NO')
	else:
		lst[3] = max(0, lst[3] - a)
		lst[4] = max(0, lst[4] - b)
		print(['YES', 'NO'][lst[3] + lst[4] > c])


t = int(input())
for _ in range(t):
	c = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	for i in range(3):
		c[i] = c[i] - a[i]
	if c[0] < 0 or c[1] < 0 or c[2] < 0:
		print('No')
	else:
		a[3] = max(0, a[3] - c[0])
		a[4] = max(0, a[4] - c[1])
		if c[2] >= a[3] + a[4]:
			print('Yes')
		else:
			print('No')


def wastesort(c, a):
	if c[0] < a[0]:
		return False
	if c[1] < a[1]:
		return False
	if c[2] < a[2]:
		return False
	c[0] = c[0] - a[0]
	c[1] = c[1] - a[1]
	c[2] = c[2] - a[2]
	if a[3] > 0:
		a[3] = a[3] - c[0]
		if a[3] > 0:
			if c[2] >= a[3]:
				c[2] = c[2] - a[3]
			else:
				return False
	if a[4] > 0:
		a[4] = a[4] - c[1]
		if a[4] > 0:
			if c[2] >= a[4]:
				c[2] = c[2] - a[4]
			else:
				return False
	return True
n = int(input())
for i in range(0, n):
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if wastesort(c, a):
		print('YES')
	else:
		print('NO')


no_of_cases = int(input())
final_ans = []
for i in range(no_of_cases):
	check = 2
	x = input()
	c = x.split()
	y = input()
	a = y.split()
	for i in range(3):
		c[i] = int(c[i])
	for i in range(5):
		a[i] = int(a[i])
	for i in range(3):
		if a[i] > c[i]:
			check = 0
		else:
			continue
	if check == 2:
		c[0] -= a[0]
		c[1] -= a[1]
		c[2] -= a[2]
		if c[0] > a[3]:
			a[3] = 0
		else:
			a[3] -= c[0]
		if c[1] > a[4]:
			a[4] = 0
		else:
			a[4] -= c[1]
		if a[3] + a[4] > c[2]:
			check = 0
		else:
			check = 1
	if check == 0:
		final_ans.append('NO')
	elif check == 1:
		final_ans.append('YES')
for i in range(len(final_ans)):
	print(final_ans[i])


for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a, b, c, d, e) = map(int, input().split())
	if c1 + c3 >= a + d + c and c2 + c3 >= b + e + c and (c1 + c2 + c3 >= a + b + c + d + e) and (c1 >= a) and (c2 >= b) and (c3 >= c):
		print('YES')
	else:
		print('NO')


def isStorable(c, a):
	if c[0] - a[0] >= 0 and c[1] - a[1] >= 0 and (c[2] - a[2] >= 0):
		c[0] -= a[0]
		c[1] -= a[1]
		c[2] -= a[2]
	else:
		return False
	if c[0] - a[3] < 0:
		a[3] -= c[0]
		if c[2] - a[3] < 0:
			return False
		else:
			c[2] -= a[3]
	if c[1] - a[4] < 0:
		a[4] -= c[1]
		if c[2] - a[4] < 0:
			return False
	return True
t = int(input())
while t:
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if isStorable(c, a):
		print('YES')
	else:
		print('NO')
	t -= 1


t = int(input())
for casos in range(t):
	(c1, c2, c3) = [int(x) for x in input().split()]
	(a1, a2, a3, a4, a5) = [int(x) for x in input().split()]
	if a1 > c1 or (a2 > c2 or a3 > c3):
		print('NO')
	else:
		resto1 = c1 - a1 - a4
		resto2 = c2 - a2 - a5
		c3 = c3 - a3
		aux1 = 0
		aux2 = 0
		if resto1 < 0:
			aux1 = resto1
		if resto2 < 0:
			aux2 = resto2
		if abs(aux1) + abs(aux2) > c3:
			print('NO')
		else:
			print('YES')


I = lambda : map(int, input().split())
for _ in [0] * int(input()):
	(x, y, z) = I()
	(a, b, c, d, e) = I()
	print('NYOE S'[x >= a and y >= b and (z >= c) and (z - c >= max(d + a - x, 0) + max(e + b - y, 0))::2])


for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if a1 > c1:
		print('NO')
		continue
	c1 -= a1
	if a2 > c2:
		print('NO')
		continue
	c2 -= a2
	if a3 > c3:
		print('NO')
		continue
	c3 -= a3
	possible = min(a4, c1)
	c1 -= possible
	a4 -= possible
	if a4 > c3:
		print('NO')
		continue
	c3 -= a4
	possible = min(a5, c2)
	c2 -= possible
	a5 -= possible
	if a5 > c3:
		print('NO')
		continue
	c3 -= a5
	print('YES')


for _ in range(int(input())):
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	for i in (0, 1, 2):
		c[i] -= a[i]
		if c[i] < 0:
			print('NO')
			break
	else:
		print(['YES', 'NO'][c[2] - a[3] + min(a[3], c[0]) - a[4] + min(a[4], c[1]) < 0])


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(c1, c2, c3) = map(int, input().split())
	(a1, a2, a3, a4, a5) = map(int, input().split())
	if a1 > c1 or a2 > c2 or a3 > c3 or (max(0, a4 - (c1 - a1)) + max(0, a5 - (c2 - a2)) > c3 - a3):
		print('NO')
	else:
		print('YES')


t = int(input())
for i in range(t):
	(c1, c2, c3) = [int(x) for x in input().split()]
	(a1, a2, a3, a4, a5) = [int(x) for x in input().split()]
	if a1 > c1 or a2 > c2 or a3 > c3:
		print('No')
	else:
		c1_ = c1 - a1
		c2_ = c2 - a2
		c3_ = c3 - a3
		if c2_ + c3_ >= a5 and c1_ + c3_ >= a4 and (c1_ + c2_ + c3_ >= a4 + a5):
			print('Yes')
		else:
			print('No')


import sys
zz = 1
sys.setrecursionlimit(10 ** 5)
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')
di = [[-1, 0], [1, 0], [0, 1], [0, -1]]

def fori(n):
	return [fi() for i in range(n)]

def inc(d, c, x=1):
	d[c] = d[c] + x if c in d else x

def ii():
	return input().rstrip()

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def gtc(tc, ans):
	print('Case #' + str(tc) + ':', ans)

def cil(n, m):
	return n // m + int(n % m > 0)

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

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

def gh():
	sys.stdout.flush()

def isvalid(i, j, n, m):
	return 0 <= i < n and 0 <= j < m

def bo(i):
	return ord(i) - ord('a')

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)
t = fi()
uu = t
while t > 0:
	t -= 1
	c = li()
	a = li()
	if sum(a) <= sum(c) and a[0] <= c[0] and (a[1] <= c[1]) and (a[2] <= c[2]) and (a[3] <= c[0] + c[2] - a[0] - a[2]) and (a[4] <= c[1] + c[2] - a[1] - a[2]):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	(ca, cb, cc) = map(int, input().split())
	(aa, ab, ac, ad, ae) = map(int, input().split())
	f = 0
	da = ca - aa
	db = cb - ab
	dc = cc - ac
	if min(da, db, dc) >= 0:
		if (da >= ad or dc >= ad or da + dc >= ad) and (db >= ae or dc >= ae or db + dc >= ae) and (da + db + dc >= ad + ae):
			f = 1
	print('YES') if f == 1 else print('NO')


for _ in range(int(input())):
	(C1, C2, C3) = map(int, input().split())
	(A1, A2, A3, A4, A5) = map(int, input().split())
	if C1 >= A1 and C2 >= A2 and (C3 >= A3):
		Num1 = C1 - A1
		Num2 = C2 - A2
		Num3 = C3 - A3
		if Num1 >= A4:
			if Num2 >= A5:
				print('YES')
			else:
				Val = A5 - Num2
				if Val <= Num3:
					print('YES')
				else:
					print('NO')
		else:
			Var = A4 - Num1
			if Var <= Num3:
				Var1 = Num3 - Var
				if Num2 >= A5:
					print('YES')
				else:
					Val = A5 - Num2
					if Val <= Var1:
						print('YES')
					else:
						print('NO')
			else:
				print('NO')
	else:
		print('NO')


T = int(input())
while T > 0:
	(c1, c2, c3) = map(int, input().split(' '))
	(a1, a2, a3, a4, a5) = map(int, input().split(' '))
	c1 -= a1
	c2 -= a2
	c3 -= a3
	flag = 0
	if c1 < 0 or c2 < 0 or c3 < 0:
		print('NO')
		flag = 1
	else:
		x = min(a4, c1)
		y = min(a5, c2)
		c1 -= x
		c2 -= y
		a4 -= x
		a5 -= y
		if a4 + a5 > c3:
			print('NO')
			flag = 1
	if flag == 0:
		print('YES')
	T -= 1


t = int(input())
for _ in range(t):
	(a, b, c) = map(int, input().split())
	arr = list(map(int, input().strip().split()))[:5]
	flag = 0
	a -= arr[0]
	b -= arr[1]
	c -= arr[2]
	if a < 0 or b < 0 or c < 0:
		flag = 1
	left = arr[3] - min(arr[3], a) + arr[4] - min(arr[4], b)
	if left > c or flag == 1:
		print('No')
	else:
		print('Yes')


def sort(c, a):
	for i in range(0, 3):
		c[i] -= a[i]
		if c[i] < 0:
			return False
	if a[3] > 0:
		if c[0] > 0:
			if c[0] >= a[3]:
				c[0] -= a[3]
				a[3] = 0
			else:
				a[3] -= c[0]
				c[0] = 0
				c[2] -= a[3]
				if c[2] < 0:
					return False
		else:
			c[2] -= a[3]
			a[3] = 0
			if c[2] < 0:
				return False
	if a[4] > 0:
		if c[1] > 0:
			if c[1] >= a[4]:
				c[1] -= a[4]
				a[4] = 0
			else:
				a[4] -= c[1]
				c[1] = 0
				c[2] -= a[4]
				if c[2] < 0:
					return False
		else:
			c[2] -= a[4]
			a[4] = 0
			if c[2] < 0:
				return False
	return True
t = int(input())
for _ in range(t):
	c = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if sort(c, a) == True:
		print('YES')
	else:
		print('NO')


n = int(input())
for i in range(n):
	c = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	c[0] -= a[0]
	c[1] -= a[1]
	c[2] -= a[2]
	if c[0] < 0 or c[1] < 0 or c[2] < 0:
		print('NO')
		continue
	a[3] -= c[0]
	a[4] -= c[1]
	c[2] -= max(0, a[3]) + max(0, a[4])
	if c[2] < 0:
		print('NO')
		continue
	print('YES')


def solve(a, b):
	a = [int(x) for x in a.split()]
	b = [int(x) for x in b.split()]
	c0 = 0
	c1 = 0
	c2 = 0
	c0 = a[0] - b[0]
	if c0 < 0:
		return 'NO'
	c0 = c0 - b[3]
	c1 = a[1] - b[1]
	if c1 < 0:
		return 'NO'
	c1 = c1 - b[4]
	c2 = a[2] - b[2]
	if c2 < 0:
		return 'NO'
	if c0 <= 0 and c1 <= 0:
		if c2 >= -1 * c0 + -1 * c1:
			return 'YES'
	if c0 >= 0 and c1 <= 0:
		if c2 >= -1 * c1:
			return 'YES'
	if c0 <= 0 and c1 >= 0:
		if c2 >= -1 * c0:
			return 'YES'
	if c0 >= 0 and c1 >= 0:
		return 'YES'
	return 'NO'
for _ in range(int(input())):
	a = input()
	b = input()
	print(solve(a, b))


t = int(input())
while t:
	L1 = input().split()
	for i in range(3):
		L1[i] = int(L1[i])
	L2 = input().split()
	for i in range(5):
		L2[i] = int(L2[i])
	if L1[0] < L2[0] or L1[1] < L2[1] or L1[2] < L2[2]:
		print('NO')
	else:
		L1[0] -= L2[0]
		L1[1] -= L2[1]
		L1[2] -= L2[2]
		if L1[0] > L2[3]:
			L2[3] = 0
		else:
			L2[3] -= L1[0]
		if L1[1] > L2[4]:
			L2[4] = 0
		else:
			L2[4] -= L1[1]
		if L2[3] + L2[4] <= L1[2]:
			print('YES')
		else:
			print('NO')
	t -= 1


t = int(input())
while t:
	(c1, c2, c3) = list(map(int, input().split()))
	(a1, a2, a3, a4, a5) = list(map(int, input().split()))
	x0 = max(0, a1 + a4 - c1)
	y0 = max(0, a2 + a5 - c2)
	x1 = c3 - a3 - y0
	y1 = c3 - a3 - x0
	if x1 >= x0 and y1 >= y0 and (c3 >= a3) and (c2 >= a2) and (c1 >= a1):
		print('YES')
	else:
		print('NO')
	t -= 1


t = int(input())

def solu():
	(c1, c2, c3) = map(int, input().split(' '))
	(a1, a2, a3, a4, a5) = map(int, input().split(' '))
	(h1, h2, h3) = (c1 - a1, c2 - a2, c3 - a3)
	if h1 < 0 or h2 < 0 or h3 < 0:
		print('NO')
		return
	if a4 and a4 >= h1:
		a4 -= h1
	else:
		a4 = 0
	if a5 and a5 >= h2:
		a5 -= h2
	else:
		a5 = 0
	if h3 >= a4 + a5:
		print('YES')
	else:
		print('NO')
for _ in range(t):
	solu()


def f():
	lst = []
	for i in range(int(input())):
		c = list(map(int, input().split()))
		a = list(map(int, input().split()))
		if a[0] > c[0] or a[1] > c[1] or a[2] > c[2]:
			lst.append('NO')
		else:
			c[0] -= a[0]
			c[1] -= a[1]
			c[2] -= a[2]
			a[0] = 0
			a[1] = 0
			a[2] = 0
			if c[0] - a[0] + c[2] - a[2] < a[3] or c[1] - a[1] + c[2] - a[2] < a[4]:
				lst.append('NO')
			else:
				c[2] -= a[3] - (c[0] - a[0]) + a[4] - (c[1] - a[1])
				if c[2] < 0:
					lst.append('NO')
				else:
					lst.append('YES')
	print(*lst, sep='\n')
f()