///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
#define        u64             uint64_t
#define        ll              long long
#define        endl            "\n"
#define        PI              acos(-1)
#define        fi              first
#define        si              second
#define        mkp             make_pair
#define        pb              push_back
#define        set0(arr)       memset(arr, 0, sizeof(arr))
#define        setinf(arr)     memset(arr, 126, sizeof(arr))
#define        all(x)          (x).begin(),(x).end()
#define        sz(v)           ((ll)(v).size())
#define        IOS             ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
using          pll        =      pair<ll, ll> ;
using          vl         =      vector<ll> ;
using          vpll       =      vector<pll> ;
using          mll        =      map<ll, ll> ;
using          mcl        =      map<char, ll> ;
using          msl        =      map<string,ll> ;
using          sl         =      set<ll> ;
using          sc         =      set<char> ;
using          dl         =      deque<ll> ;
const int N = 1e6+5 ;

ll      mod = 1e9+7 ;
vl      adj[N] ;
vpll    adjc[N] ;
ll      vis[N] ;
ll      arr[N] ;

ll sumd(ll a,ll b){return (((a%mod)+(b%mod))%mod);}
ll muld(ll a,ll b){return (((a%mod)*(b%mod))%mod);}
ll subd(ll a,ll b){return (((a%mod)-(b%mod)+mod)%mod);}



int main()
{
    IOS;
    ll a, b, c, d, n, m, p, x, y, z, i, j, k, f = 0, tc, cnt = 0, sum = 0, mul = 1, mi = 1e18, ma = -1e18, cs;
    string   str ;
    char     ch ;
    double   db ;
    ll       l, r ;
    //code

    cin>>tc;
    for(cs=1;cs<=tc;cs++)
    {
        ll c1,c2,c3,a1,a2,a3,a4,a5;
        cin>>c1>>c2>>c3;
        cin>>a1>>a2>>a3>>a4>>a5;
        c1-=a1;
        c2-=a2;
        c3-=a3;
        if(c1<0||c2<0||c3<0)
        {
               cout<<"NO\n";continue;
        }
        if(c1>=a4)
        {
                       if(c2>=a5){}
                       else
                       {
                           a5-=c2;
                           c3-=a5;
                           if(c3<0)
                           {
                                 cout<<"NO\n";continue;
                           }
                       }
        }
        else
        {
               a4-=c1;
               c3-=a4;
               if(c3<0)
               {
                      cout<<"NO\n";continue;
               }
               else
               {
                                  if(c2>=a5);
               else
              {
              a5-=c2;
              c3-=a5;
              if(c3<0)
              {
              cout<<"NO\n";continue;
              }
              }
              }
        }
        cout<<"YES\n";

    }


    //code
    return 0;
}
