#include <bits/stdc++.h>
using namespace std;
const long long INF = 9223372036854775807 - 1;
const int inf = 2147483647 - 1;
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
int t;
long long a[300];
long long b[300];
long long c[300];
long long d[300];
long long p[300];
long long q[300];
long long r[300];
long long s[300];
int main() {
  cin >> t;
  for (long long i = 0; i < t; i++) {
    cin >> p[i] >> q[i] >> r[i] >> s[i];
    a[i] = p[i] % q[i];
    b[i] = q[i];
    c[i] = r[i];
    d[i] = s[i] % q[i];
  }
  for (long long i = 0; i < t; i++) {
    if (p[i] < q[i]) {
      cout << "No" << endl;
      ;
    } else if (q[i] - s[i] > 0) {
      cout << "No" << endl;
      ;
    } else if (d[i] != 0) {
      long long m1, m2;
      m1 = (c[i] - a[i]) / d[i];
      if ((b[i] - a[i]) % d[i] != 0) {
        m2 = (b[i] - a[i]) / d[i] + 1;
      } else {
        m2 = (b[i] - a[i]) / d[i];
      }
      if ((m2 - m1) > 1) {
        cout << "No" << endl;
        ;
      } else {
        cout << "Yes" << endl;
        ;
      }
    } else {
      if (a[i] > c[i]) {
        cout << "No" << endl;
        ;
      } else {
        cout << "Yes" << endl;
        ;
      }
    }
  }
  return 0;
}
