#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  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 k = max(0LL, (A - C + B - 1) / B);
    A -= k * B;
    if (A < 0) {
      cout << "No" << endl;
      continue;
    }
    long long diff = D - B;
    if (!diff) {
      cout << "Yes" << endl;
      continue;
    }
    bool bad = false;
    for (int i = 0; i < 1000; i++) {
      long long val = (C - A) / diff + 1;
      if (A + val * diff < B) {
        bad = true;
      } else
        A = A + val * diff - B;
    }
    if (bad)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
