#include <bits/stdc++.h>
using namespace std;
long long A, B, C, D;
long long rd() {
  long long r;
  cin >> r;
  return r;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
void solve() {
  A = rd(), B = rd(), C = rd(), D = rd();
  if (B > D) {
    puts("No");
    return;
  }
  if (B <= C) {
    puts("Yes");
    return;
  }
  if (gcd(B, D) == 0) {
    puts("Yes");
    return;
  }
  A %= B;
  long long k = (B - 1 - A) / gcd(B, D);
  if (A + k * gcd(B, D) <= C)
    puts("Yes");
  else
    puts("No");
  return;
}
int main() {
  for (long long T = rd(); T; T--) solve();
  return 0;
}
