#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
void ans(int A, int B, int C, int D) {
  if (A < B) {
    cout << "No" << endl;
  } else {
    if (B > D) {
      cout << "No" << endl;
    } else {
      if (B <= C) {
        cout << "Yes" << endl;
      } else {
        int x = gcd(B, D);
        int mini = A;
        while (mini - x > C) mini -= x;
        if (mini >= B)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      }
    }
  }
}
int main() {
  int T;
  cin >> T;
  int A, B, C, D;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    ans(A, B, C, D);
  }
  return 0;
}
