#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  long long A, B, C, D;
  cin >> T;
  for (int i = 0; i < (T); i++) {
    cin >> A >> B >> C >> D;
    if (D < B || A < B) {
      cout << "No" << endl;
      continue;
    }
    set<long long> sll;
    bool ok;
    long long delta = D % B;
    while (true) {
      if (A < B) {
        ok = false;
        break;
      }
      A -= ceil((double)(A - C) / B) * B;
      if (A < 0) {
        ok = false;
        break;
      }
      if (delta == 0) {
        ok = true;
        break;
      }
      long long x = ceil((double)(C - A) / delta + 0.000000001);
      A += delta * x;
      if (sll.find(A) != sll.end()) {
        ok = true;
        break;
      }
      sll.insert(A);
    }
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
