#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (d < b || a < b) {
    cout << "No" << endl;
    return;
  }
  if (b <= c + 1) {
    cout << "Yes" << endl;
    return;
  }
  long long g = gcd(b, d);
  long long mx = a % b + (ceil(((double)b - a % b) / g) - 1) * g;
  if (mx <= c) {
    cout << "Yes" << endl;
    return;
  }
  cout << "No" << endl;
}
int main() {
  int num_cases;
  cin >> num_cases;
  for (int i = 0; i < num_cases; ++i) {
    solve();
  }
}
