#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 2e9;
const int MAX_N = 1;
bool inC(long long x, long long C) { return 0 <= x && x <= C; }
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (B > D) {
      cout << "No" << endl;
      continue;
    }
    long long POS = A - B;
    if (POS > C) {
      POS -= ((POS - C) + 1) / B * B;
    }
    long long DIFF = D - B;
    if (!inC(POS, C) && POS < B) {
      cout << "No" << endl;
      continue;
    }
    if (B == D) {
      if (inC(POS, C)) {
        cout << "Yes" << endl;
        continue;
      }
      cout << "No" << endl;
      continue;
    }
    if (POS + ((C - POS) / DIFF + 1) * DIFF < B) {
      cout << "No" << endl;
      continue;
    }
    if (B <= C + DIFF) {
      cout << "Yes" << endl;
      continue;
    }
    cout << "No" << endl;
    continue;
  }
  return 0;
}
