#include <bits/stdc++.h>
long long int MOD = 1e9 + 7;
using namespace std;
string alphabet("abcdefghijklmnopqrstuvwxyz");
long long int gcd(long long a, long long b) {
  if (a == 0) return b;
  if (a > b) return gcd(b, a);
  return gcd(b % a, a);
}
int main() {
  int t;
  cin >> t;
  while (t) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long g = gcd(b, d);
    long long G = gcd(c, gcd(a, g));
    a /= G;
    b /= G;
    c /= G;
    d /= G;
    g /= G;
    long long l = c + 1;
    if (l % g < a % g) {
      l += (a % g - l % g);
    } else if (l % g > a % g) {
      l += (g + a % g - l % g);
    }
    long long s = min(l, l - b + d);
    if (a < b) {
      cout << "No" << endl;
      t--;
      continue;
    }
    if (a - b < c && d < b) {
      cout << "No" << endl;
      t--;
      continue;
    }
    if (a - b < c && d == b) {
      cout << "Yes" << endl;
      t--;
      continue;
    }
    if (s < b) {
      cout << "No" << endl;
    } else
      cout << "Yes" << endl;
    t--;
  }
}
