#include <bits/stdc++.h>
using namespace std;
void doRoutine() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  srand(322179);
}
void solve(long long a, long long b, long long c, long long d) {
  if (a < b) {
    cout << "No" << endl;
  } else {
    if (d < b) {
      cout << "No" << endl;
    } else {
      if (c >= b - 1) {
        cout << "Yes" << endl;
      } else {
        a %= b, d %= b, c %= b;
        if (d == 0) {
          if (a > c) {
            cout << "No" << endl;
          } else {
            cout << "Yes" << endl;
          }
          return;
        }
        long long l = -1, r = (b - a) / d + 3;
        while (r - l > 1) {
          long long m = (l + r) / 2;
          if (a + m * d > c) {
            r = m;
          } else {
            l = m;
          }
        }
        if (a + r * d < b) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      }
    }
  }
}
signed main() {
  doRoutine();
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    solve(a, b, c, d);
  }
  return 0;
}
