#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int T;
  int A[300], B[300], C[300], D[300];
  int x;
  cin >> T;
  for (int i = 0; i < T; i++) {
    cin >> A[i];
    cin >> B[i];
    cin >> C[i];
    cin >> D[i];
  }
  for (int j = 0; j < T; j++) {
    x = A[j] - B[j];
    if (x < 0) {
      cout << "No" << endl;
    }
    if (x >= 0) {
      cout << "Yes" << endl;
    }
    if (x <= C[j]) {
      x += D[j];
      A[j + 1] = x;
    }
  }
  return 0;
}
