#include <bits/stdc++.h>
using namespace std;
int gcd(long long a, long long b) {
  if (b > a) return gcd(b, a);
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  long long T;
  cin >> T;
  for (long long t = 0; t < T; t++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if ((a < b) || (d < b)) {
      cout << "No" << endl;
      continue;
    }
    if (c > b) {
      cout << "Yes" << endl;
      continue;
    }
    if (d > b) {
      long long g = gcd(d, b);
      long long tmp = c - b + g;
      tmp -= (a % b) % g;
      if (tmp >= 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
    if (d == b) {
      if (a % b <= c)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
}
