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