#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return !a ? b : gcd(b % a, a); }
void solve() {
  long long A, B, C, D;
  cin >> A >> B >> C >> D;
  if (B > D) {
    cout << "No" << endl;
    return;
  }
  if (C >= B) {
    cout << "Yes" << endl;
    return;
  }
  if (B == D) {
    if (A % B > C) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
    return;
  }
  long long t = gcd(D - B, B);
  long long v = (B - 1 - (A % B)) / t * t + (A % B);
  if (v > C) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}
int main() {
  int T;
  ios::sync_with_stdio(0);
  cin >> T;
  while (T--) solve();
  return 0;
}
