#include <bits/stdc++.h>
using namespace std;
using vi = vector<long long>;
using pint = pair<long long, long long>;
inline void io() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.tie(0);
  cout << fixed << setprecision(20);
}
inline long long in() {
  long long n;
  scanf("%lld", &n);
  return n;
}
inline void out(long long n) { printf("%lld\n", n); }
const long long INF = 1LL << 55;
const long long MOD = 1000000007;
const double EPS = 1e-8;
long long n;
long long a, b, c, d;
long long tmp;
set<long long> used;
void solve() {
  used.clear();
  if (b > d || a < b) {
    puts("No");
    return;
  }
  if (b <= c) {
    puts("Yes");
    return;
  }
  tmp = a;
  while (true) {
    tmp %= b;
    if (used.find(tmp) != used.end()) {
      puts("Yes");
      return;
    }
    if (tmp <= c) {
      used.insert(tmp);
      tmp += d;
      continue;
    } else {
      puts("No");
      return;
    }
  }
}
signed main() {
  io();
  cin >> n;
  while (n--) {
    cin >> a >> b >> c >> d;
    solve();
  }
  return 0;
}
