#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  vector<long long> A(t), B(t), C(t), D(t);
  for (int i = (0); i < (int)(t); i++) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
  }
  for (int i = (0); i < (int)(t); i++) {
    bool yes = true;
    long long a = A[i];
    long long b = B[i];
    long long c = C[i];
    long long d = D[i];
    if (d < b || a < b)
      yes = false;
    else if (a % b > c)
      yes = false;
    else {
      if (d - b != 0) {
        double xx = (double)(c + d - b - (a - b)) / (d - b);
        long long x = xx;
        cerr << x << endl;
        cerr << a % b << endl;
        if ((a - b) + x * (d - b) >= b)
          yes = 1;
        else
          yes = false;
      } else {
        if (a % b <= c)
          yes = 1;
        else
          yes = false;
      }
    }
    cout << (yes ? "Yes" : "No") << endl;
    ;
  }
  return 0;
}
