#include <bits/stdc++.h>
using namespace std;
long long n, a[300003], b[300003], c[300003], d[300003];
long long gcd(long long x, long long y) {
  if (x % y == 0) return y;
  return gcd(y, x % y);
}
int main() {
  cin >> n;
  for (int i = (int)0; i < (int)n; i++) cin >> a[i] >> b[i] >> c[i] >> d[i];
  for (int i = (int)0; i < (int)n; i++) {
    if (b[i] > a[i] || b[i] > d[i]) {
      cout << "No" << endl;
      continue;
    }
    long long z = gcd(b[i], c[i]);
    if (c[i] + z < b[i])
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
