#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  long long A, B, C, D, E, F, G;
  cin >> T;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    if (A < B || B > D) cout << "No" << endl;
    if (A > C) {
      G = A - C;
      A -= B * (G / B);
    }
    if (D == B && A >= B)
      cout << "Yes" << endl;
    else {
      if (D == B)
        cout << "No" << endl;
      else {
        E = A - B * (A / B);
        F = ((C - E + D - B - 1) / (D - B)) * (D - B) + E;
        if (F == C) F += D - B;
        if (F < B)
          cout << "No" << endl;
        else
          cout << "Yes" << endl;
      }
    }
  }
  return 0;
}
