#include <bits/stdc++.h>
using namespace std;
const long long MD = 1000000007;
int gcd(int a, int b) {
  int t;
  while (b != 0) {
    t = a % b;
    a = b;
    b = t;
  }
  return a;
}
int T;
long long a, b, c, d;
long long start;
void judge() {
  if (a < b) {
    cout << "No" << endl;
    return;
  }
  if (b > d) {
    cout << "No" << endl;
    return;
  }
  if (a - (a / b) * b > c) {
    cout << "No" << endl;
    return;
  }
  if (d % b == 0) {
    cout << "Yes" << endl;
    return;
  }
  if (c >= b) {
    cout << "Yes" << endl;
    return;
  }
  long long e = gcd(b, d);
  start = b - e + a % e;
  if (start > c) {
    cout << "No" << endl;
    return;
  } else {
    cout << "Yes" << endl;
    return;
  }
}
int main() {
  cin >> T;
  for (int i = 0; i < T; i++) {
    cin >> a >> b >> c >> d;
    judge();
  }
  return 0;
}
