#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  while (1) {
    long long c = a % b;
    if (c == 0) {
      return b;
    }
    a = b;
    b = c;
  }
  return 1;
}
int can(long long a, long long b, long long c, long long d) {
  if (a < b || b > d) {
    return 0;
  }
  long long k = GCD(d, b);
  int a0 = a % k;
  for (long long i = 0; i < 1 + b / k; i++) {
    long long x = a0 + k * i;
    if (x > c && x < b) {
      return 0;
    }
    if (x >= b) {
      return 1;
    }
  }
  return 1;
}
int main() {
  int t;
  long long a[301];
  long long b[301];
  long long c[301];
  long long d[301];
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (int i = 0; i < t; i++) {
    if (can(a[i] % b[i] + b[i], b[i], c[i], d[i])) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
