#include <bits/stdc++.h>
using namespace std;
const long long INF = 1l << 60;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  long long r = a % b;
  if (r == 0) return b;
  return gcd(b, r);
}
void solve() {
  long long A, B, C, D;
  cin >> A >> B >> C >> D;
  if (A <= B - 1) {
    cout << "No" << endl;
    return;
  }
  A -= ((A - C - 1) / B) * B;
  long long g = gcd(A, B);
  g = gcd(g, C);
  g = gcd(g, D);
  A /= g;
  B /= g;
  C /= g;
  D /= g;
  if (A <= B - 1) {
    cout << "No" << endl;
    return;
  }
  if (D <= B - 1) {
    cout << "No" << endl;
    return;
  }
  if (C >= B - 1) {
    cout << "Yes" << endl;
    return;
  }
  if (gcd(B, D) == 1) {
    cout << "No" << endl;
    return;
  }
  long long delta = D - B;
  if (delta == 0) {
    cout << "Yes" << endl;
    return;
  } else if (delta <= B - C - 1) {
    cout << "No" << endl;
    return;
  }
  long long s = A - B;
  long long l = B - 1;
  long long x = s + (l - s) / delta;
  if (C + 1 <= x) {
    cout << "No" << endl;
    return;
  }
  cout << "Yes" << endl;
  return;
}
signed main() {
  long long T;
  cin >> T;
  for (long long i = 0; i < (T); ++i) {
    solve();
  }
  return 0;
}
