#include <bits/stdc++.h>
using namespace std;
long long longinf = 1ll << 60;
int T;
long long A, B, C, D;
long long gcd(long long a, long long b) {
  if (a > b) return gcd(b, a);
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
int main() {
  cin >> T;
  for (int gu = (int)0; gu < (int)T; gu++) {
    cin >> A >> B >> C >> D;
    bool ok = false;
    if (B <= C + gcd(A, gcd(B, D)) && B <= D) ok = true;
    if ((A - A % B - D) % B == 0 && (A % B) <= C && B <= D)
      ok = true;
    else {
      if (B == D) {
        if (A % B <= C) ok = true;
      }
    }
    if (A < B) ok = false;
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
