#include <bits/stdc++.h>
using namespace std;
int t;
long long a, b, c, d;
bool ans = 0;
void solve();
void solve2();
int main() {
  int roop;
  cin >> t;
  for (roop = 0; roop < t; ++roop) {
    cin >> a >> b >> c >> d;
    ans = 0;
    if (a < b) ans = 1;
    if (a % b > c) ans = 1;
    if (a % b + d < b) ans = 1;
    if (!ans) solve2();
    if (ans)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
void solve() {
  long long now = a % b;
  map<long long, bool> sets;
  while (sets.find(now) == sets.end() && ans == 0) {
    if (c < now || now < b - d) ans = 1;
    sets[now] = 1;
    now += d % b;
    now %= b;
  }
}
void solve2() {
  long long now = a % b;
  long long l = min(c, d) - now;
  long long r = b - now;
  long long tgt = d % b;
  if (tgt == 0) return;
  if (d / b > 0) return;
  if (l / tgt + (!r % tgt) < r / tgt + 1 + (!r % tgt)) ans = 1;
}
