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