#include <bits/stdc++.h>
using namespace std;
#define ll long long int


void solve() {
    ll c1,c2,c3;
    cin>>c1>>c2>>c3;
    ll a1,a2,a3,a4,a5;
    cin>>a1>>a2>>a3>>a4>>a5;
    if(c1<a1||c2<a2||c3<a3){cout<<"NO"<<endl;return;}
    c1-=a1;c2-=a2;c3-=a3;
    if((c1>=a4)&&(c2+c3>=a5)||(c2>=a5)&&(c1+c3>=a4)||
            (c1<a4)&&(c2<a5)&&(c1+c2+c3>=a4+a5)
    ){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
}


int main()
{
    // clock_t time_req = clock();
//    ios::sync_with_stdio(false);
//    cin.tie(0), cout.tie(0);
    int t;
    cin>>t;
    while(t!=0){
        solve();
        t--;
    }
    // time_req = clock() - time_req;
    // cout << (float)time_req / CLOCKS_PER_SEC;
    return 0;
}