#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
using namespace std;
ll MOD = 1e9 + 7;
ll gcd(ll a, ll b)
{
	if (b == 0)
	{
		return a;
	}
	return gcd(b, a % b);
}

void solver()
{
	ll flag=0;
	ll lefta=0,a,leftb=0,b,leftc=0,c;
	cin>>a>>b>>c;
	ll a1,a2,a3,a4,a5;
	cin>>a1>>a2>>a3>>a4>>a5;
	if(a1>a)
	{
		flag=1;
	}
	else
	{
		lefta=(a-a1);
	}
	if(a2>b)
	{
		flag=1;
	}
	else
	{
		leftb=(b-a2);	
	}
	if(a3>c)
	{
		flag=1;
	}
	else
	{
		leftc=(c-a3);
	}
	//cout<<flag<<"\n";
	if(lefta+leftb+leftc>=a4+a5)
	{
		if(lefta+leftc>=a4)
		{
			if(lefta>=a4)
			{
				a4=0;
			}
			else
			{
				a4-=lefta;
				if(leftc>=a4)
				{
					a4=0;
				}
				else
				{
					flag=1;
				}
				
			}
		}
		else
		{
			flag=1;
		}
		
			if (leftb + leftc >= a5)
			{
				if (leftb >= a5)
				{
					a5 = 0;
				}
				else
				{
					a5 -= leftb;
					if (leftc >= a5)
					{
						a5 = 0;
					}
					else
					{
						flag = 1;
					}
				}
				//cout<<a5<<"\n";
			}
			else
			{
				flag=1;
			}
			
	}
	else
	{
		flag=1;
	}
	
	if(flag==1)
	{
		cout<<"NO\n";
	}
	else
	{
		cout<<"YES\n";
	}
	
}
int main()
{
	ios_base::sync_with_stdio(NULL);
	cin.tie(NULL);
	ll t = 1;
	cin>>t;
	while (t--)
	{
		solver();
	}
	return 0;
}