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