#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a > b) return gcd(b, a);
  if (b % a == 0) return a;
  return gcd(a, b % a);
}
int main() {
  long long t;
  cin >> t;
  for (long long i = 0; i < t; ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << (false ? "Yes" : "No") << endl;
    } else if (b == d) {
      cout << (a % b <= c ? "Yes" : "No") << endl;
    } else {
      long long g1 = gcd(a, gcd(b, gcd(c, d))), g2 = gcd(a, gcd(c, d));
      cout << (b / g1 <= c / g1 + 1 || b / g2 + (b % g2 != 0) <= c / g2 + 1
                   ? "Yes"
                   : "No")
           << endl;
    }
  }
  return 0;
}
