#include <bits/stdc++.h>
using namespace std;
long long dx[8] = {0, 1, 1, 1, 0, -1, -1, -1},
          dy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
template <class T>
inline bool maxi(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool mini(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  long long t, a[300], b[300], c[300], d[300];
  cin >> t;
  for (int i = (0), i_len = (t); i < i_len; ++i)
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  long long p, now;
  for (int i = (0), i_len = (t); i < i_len; ++i) {
    if (a[i] < b[i]) {
      cout << ("No") << "\n";
      continue;
    }
    if (d[i] > b[i]) d[i] = d[i] % b[i] + b[i];
    p = d[i] - b[i];
    a[i] = a[i] % b[i];
    if (p) a[i] %= p;
    now = a[i] + p;
    long long mo = a[i];
    bool f = 0;
    do {
      if (now > c[i]) {
        mo = now;
        now -= b[i];
        if (now < 0) {
          cout << ("No") << "\n";
          goto L_break1;
        }
        f = 1;
        continue;
      }
      if (now < 0) {
        cout << ("No") << "\n";
        goto L_break1;
      }
      if (p && (c[i] - now) / p > 1)
        now += p * ((c[i] - now) / p);
      else
        now += p;
    } while (now != mo && !f);
    cout << ("Yes") << "\n";
  L_break1:;
  }
  1;
}
