#include <bits/stdc++.h>
using namespace std;
static const long long INF = 1e18;
static const long long MAX = 1e5 + 7;
static const long long MOD = 1e9 + 7;
void chmax(long long a, long long b) {
  if (a < b) a = b;
}
void chmin(long long a, long long b) {
  if (a > b) a = b;
}
long long max(long long a, long long b) { return a > b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int main(void) {
  long long N;
  cin >> N;
  for (long long _ = 0; _ < N; _++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No"
           << "\n";
    } else if (b <= c) {
      cout << "Yes"
           << "\n";
    } else {
      long long g = gcd(b, d);
      long long t = (c - a) / g + 1;
      if (a + t * g < b) {
        cout << "No"
             << "\n";
      } else {
        cout << "Yes"
             << "\n";
      }
    }
  }
}
