#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const long long INF = 1LL << 29;
const long long mod = 1e9 + 7;
long long dp[1000000] = {};
int main() {
  long long T;
  cin >> T;
  long long A[T], B[T], C[T], D[T];
  for (long long(i) = (0); (i) < (T); ++i) cin >> A[i] >> B[i] >> C[i] >> D[i];
  for (long long(i) = (0); (i) < (T); ++i) {
    if (A[i] < B[i] || D[i] < B[i]) {
      cout << "No" << endl;
      continue;
    }
    if (B[i] <= C[i]) {
      cout << "Yes" << endl;
      continue;
    }
    long long multiple = D[i] - B[i];
    long long judge = A[i];
    bool ans = true;
    long long j = 0;
    while (judge != 0) {
      dp[j] = judge;
      judge += multiple;
      judge = judge % B[i];
      if (C[i] < judge && judge < B[i]) {
        ans = false;
        break;
      }
      j++;
      for (long long(k) = (0); (k) < (j); ++k) {
        if (dp[k] == judge) {
          judge = 0;
          break;
        }
      }
    }
    if (ans) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    for (long long(k) = (0); (k) < (j); ++k) dp[k] = 0;
  }
  return 0;
}
