#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
const long long INF = 100000000000000000;
const long long MAX_T = 305;
long long T;
long long A[MAX_T], B[MAX_T], C[MAX_T], D[MAX_T];
long long gcd(long long m, long long n) {
  if ((0 == m) || (0 == n)) return 0;
  if (m < n) {
    swap(m, n);
  }
  while (n != 0) {
    long long nn = m % n;
    m = n;
    n = nn;
  }
  return m;
}
signed main() {
  cin >> T;
  for (long long i = 0; i < T; i++) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
    if (D[i] < B[i] || A[i] < B[i]) {
      cout << "No" << endl;
      continue;
    }
    if (D[i] == B[i]) {
      long long X = A[i] % B[i];
      if (C[i] >= X) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
      continue;
    }
    if (C[i] >= B[i]) {
      cout << "Yes" << endl;
      continue;
    }
    unordered_set<long long> SET;
    long long AA = A[i];
    SET.insert(AA);
    AA %= B[i];
    if (C[i] < AA) {
      cout << "No" << endl;
      continue;
    }
    long long oldAA = AA;
    AA += D[i];
    AA %= B[i];
    if (C[i] < AA) {
      cout << "No" << endl;
      continue;
    }
    long long diffAA = AA - oldAA;
    if (diffAA == 0) {
      cout << "Yes" << endl;
      continue;
    }
    long long GCD = gcd(diffAA, C[i]);
    if (B[i] - C[i] <= GCD) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
