#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int T;
  cin >> T;
  for (int i = 0; i < T; i++) {
    long long int A, B, C, D;
    cin >> A >> B >> C >> D;
    int day = 0;
    for (int j = 0; j < 15; j++) {
      if (j == 0) {
        if (A - B < 0) {
          cout << "No" << endl;
          break;
        } else {
          if (A - B > C)
            day = A - B;
          else
            day = A - B + D;
        }
      } else {
        if (day - B < 0) {
          cout << "No" << endl;
          ;
          break;
        } else if (day - B > C)
          day = day - B;
        else if (day - B <= C)
          day = day - B + D;
      }
      if (j == 14) cout << "Yes" << endl;
    }
  }
}
