#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  long long abcds[t][4];
  for (int i = 0; i < t; i++) {
    cin >> abcds[i][0] >> abcds[i][1] >> abcds[i][2] >> abcds[i][3];
  }
  long long a, b, c, d;
  long long qd, q1, q2, qa;
  long long e, n;
  double m;
  for (int j = 0; j < t; j++) {
    a = abcds[j][0];
    b = abcds[j][1];
    c = abcds[j][2];
    d = abcds[j][3];
    if (a < b || d < b) {
      cout << "No" << endl;
    } else {
      if (c < b) {
        qd = d % b;
        qa = a % b;
        e = b - qa;
        if (qd == 0) {
          n = qa;
        } else {
          while (qd != 0) {
            q2 = qd;
            qd = e % qd;
            e = q2;
          }
          m = (b - qa) / e;
          if (ceil(m) == floor(m)) {
            m--;
          } else {
            m = floor(m);
          }
          n = qa + m * e;
        }
        if (c < n) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      } else {
        cout << "Yes" << endl;
      }
    }
  }
  return 0;
}
