#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 123;
const int MOD = (int)1e9 + 7;
const int inf = (int)5e8;
const long long infll = (long long)1e17;
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a < b) {
    cout << "No" << endl;
    return;
  }
  a -= b;
  if (b > d) {
    cout << "No" << endl;
    return;
  }
  if (b <= c) {
    cout << "Yes" << endl;
    return;
  }
  if (a > c) {
    a = a - ((a - c + b - 1) / b) * b;
  }
  for (int i = 0; i <= 1e5; ++i) {
    a += d;
    long long to_go = (a - c + b - 1) / b;
    if (a - (to_go - 1) * b >= c && a - (to_go - 1) * b <= b - 1) {
      cout << "No" << endl;
      return;
    }
    a -= to_go * b;
  }
  cout << "Yes" << endl;
}
int main() {
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
