#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e19;
const long long MOD = 998244353;
long long gcd(long long n, long long m) {
  if (n > m) {
    long long l = n;
    n = m;
    m = l;
  }
  while (1) {
    long long l = n;
    n = m % n;
    m = l;
    if (n == 0) {
      break;
    }
  }
  return m;
}
int main() {
  long long T;
  cin >> T;
  long long i, j;
  for (i = 0; i < T; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    long long g = gcd(gcd(A, B), gcd(C, D));
    A /= g;
    B /= g;
    C /= g;
    D /= g;
    if (A < B || D < B)
      cout << "No" << endl;
    else if (C >= B - 1)
      cout << "Yes" << endl;
    else {
      if (A % B <= C && D % B == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
}
