#include <bits/stdc++.h>
using namespace std;
long int gcm(long int a, long int b) {
  long int r, tmp;
  if (a < b) {
    tmp = a;
    a = b;
    b = tmp;
  }
  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
bool solve(long int a, long int b, long int c, long int d) {
  if (a < b) return false;
  if (b > d) return false;
  long int x = a % b;
  long int y = gcm(b, d);
  if (a % b > c) return false;
  if (x + y * (1 + (c - x) / y) - b < 0) return false;
  return true;
}
int main(void) {
  long int　n, a, b, c, d;
  cin >> n;
  for (long int i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    if (solve(a, b, c, d))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
