#include <bits/stdc++.h>
using namespace std;
const int h1[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int h2[8] = {0, 1, 1, 1, 0, -1, -1, -1};
long long dai(long long a, long long b) { return max(a, b); }
long long syo(long long a, long long b) { return min(a, b); }
long long t;
vector<long long> a(310), b(310), c(310), d(310);
long long kou(long long a, long long b) {
  long long kyou;
  if (b == 0)
    kyou = a;
  else
    kyou = kou(b, a % b);
  return kyou;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> t;
  for (long long j = 0; j < long long(t); ++j) {
    cin >> a[j];
    cin >> b[j];
    cin >> c[j];
    cin >> d[j];
  }
  for (long long j = 0; j < long long(t); ++j) {
    if (a[j] < b[j] || b[j] > d[j]) {
      cout << "No" << endl;
    } else if (b[j] - 1 <= c[j]) {
      cout << "Yes" << endl;
    } else {
      a[j] %= b[j];
      d[j] %= b[j];
      if (kou(b[j], d[j]) == 1) {
        cout << "No" << endl;
      } else {
        bool s = 1;
        for (long long k = c[j] + 1; k < long long(b[j]); ++k) {
          if (a[j] % kou(b[j], d[j]) == k % kou(b[j], d[j])) {
            s = 0;
          }
        }
        if (s)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      }
    }
  }
  return 0;
}
