#include <bits/stdc++.h>
using namespace std;
const long long MOD = pow(10, 9) + 7;
const long long LLINF = pow(2, 61) - 1;
const int INF = pow(2, 30) - 1;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  return b == 0 ? a : gcd(b, a % b);
}
int main() {
  int T;
  cin >> T;
  for (int i = 0; i < (int)T; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (B > D) {
      cout << "No" << endl;
      continue;
    }
    if (C >= B) {
      cout << "Yes" << endl;
      continue;
    }
    if (D % B == 0) {
      string result = (A % B <= C) ? "Yes" : "No";
      cout << result << endl;
      continue;
    }
    long long gbd = gcd(B, D);
    long long gbc = gcd(gbd, C);
    string result = (B - C == gbc) ? "Yes" : "No";
    cout << result << endl;
  }
  return 0;
}
