#include <bits/stdc++.h>
using namespace std;
int gcd(long long a, long long b) {
  if (b == 0) return a;
  if (a % b == 0)
    return b;
  else
    gcd(b, a % b);
}
int solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a < b || d < b)
    return 0;
  else {
    if (c >= b)
      return 1;
    else {
      long long base = a % b;
      long long plus = d % b;
      long long cnt = (c - base) / gcd(plus, b);
      if (plus == 0 && base > c) return 0;
      if ((cnt + 1) * gcd(plus, b) + base < b)
        return 0;
      else
        return 1;
    }
  }
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; t++) {
    if (solve())
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
