#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <numeric>

#define ll long long

using namespace std;

int main()
{
  ll t;
  cin >> t;
  while (t--) {
    ll c1, c2, c3;
    cin >> c1 >> c2 >> c3;

    ll a1, a2, a3, a4, a5;
    cin >> a1 >> a2 >> a3 >> a4 >> a5;

    ll diff = min(a1, c1);
    c1 -= diff;
    a1 -= diff;

    diff = min(a2, c2);
    c2 -= diff;
    a2 -= diff;

    diff = min(a3, c3);
    c3 -= diff;
    a3 -= diff;

    diff = min(a4, c1);
    c1 -= diff;
    a4 -= diff;

    diff = min(a4, c3);
    c3 -= diff;
    a4 -= diff;

    diff = min(a5, c2);
    c2 -= diff;
    a5 -= diff;

    diff = min(a5, c3);
    c3 -= diff;
    a5 -= diff;
    if (a1 > 0 || a2 > 0 || a3 > 0 || a4 > 0 || a5 > 0) {
      cout << "NO" << '\n';      
    } else {
      cout << "YES" << '\n';
    }
  }
}