#include <bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  if (a == 0 || b == 0) return 0;
  if (a == b) return a;
  if (a > b) return gcd(a - b, b);
  return gcd(a, b - a);
}
int main() {
  unsigned long long t, a[300], b[300], c[300], d[300], x;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
    x = a[i];
    if (b[i] > d[i] || a[i] < b[i]) {
      cout << "No" << endl;
    } else if (b[i] <= c[i]) {
      cout << "Yes" << endl;
    } else {
      bool f = 1;
      for (unsigned long long j = c[i] + 1; j < b[i]; j++) {
        if ((a[i] - j) % gcd(b[i], d[i]) == 0) {
          cout << "No" << endl;
          f = 0;
          break;
        }
      }
      if (f) {
        cout << "Yes" << endl;
      }
    }
  }
}
