#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
long double sqrtld(long double x) {
  long double left = 0, right = x;
  for (long long i = 0; i < (long long)100; i++) {
    long double mid = (left + right) / 2;
    if (mid * mid <= x)
      left = mid;
    else
      right = mid;
  }
  return left;
}
long long gcd(long long a, long long b) {
  if (b > a) {
    long long c = b;
    b = a;
    a = c;
  }
  long long d = a % b;
  if (d == 0) {
    return b;
  } else if (d == 1) {
    return 1;
  } else {
    gcd(b, d);
  }
}
long long a[300], b[300], c[300], d[300];
int main() {
  int t;
  cin >> t;
  for (long long i = 0; i < (long long)t; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (long long i = 0; i < (long long)t; i++) {
    int e = a[i] % b[i];
    int g = gcd(b[i], d[i]);
    if (c[i] < b[i] - g + a[i] % g) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
