#include <bits/stdc++.h>
using namespace std;
const long long int INF = (1LL << 60);
const int INF_INT = 2147483647 - 1e6 - 1;
const long long int mod = 1000000007ll;
const int mod_int = 1000000007;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
int T;
long long int A[300], B[300], C[300], D[300];
string ans[300];
void solve() {
  for (int i = 0; i < T; i++) {
    if (B[i] > D[i]) {
      ans[i] = "No";
      continue;
    }
    if (B[i] <= C[i] + 1) {
      ans[i] = "Yes";
      continue;
    }
    long long int G = gcd(B[i], D[i]);
    long long int lower;
    if ((C[i] - A[i]) % G == 0)
      lower = (C[i] - A[i]) / G + 1LL;
    else {
      lower = (C[i] - A[i]) / G;
      if (C[i] - A[i] > 0) lower++;
    }
    long long int upper;
    if ((B[i] - A[i]) % G == 0)
      upper = (B[i] - A[i]) / G - 1LL;
    else {
      upper = (B[i] - A[i]) / G;
      if (C[i] - A[i] < 0) upper--;
    }
    if (upper - lower >= 0)
      ans[i] = "No";
    else
      ans[i] = "Yes";
  }
}
int main() {
  cin >> T;
  for (int i = 0; i < T; i++) cin >> A[i] >> B[i] >> C[i] >> D[i];
  solve();
  for (int i = 0; i < T; i++) cout << ans[i] << endl;
  return 0;
}
