#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;
  }
  if (gcd(b, d) == 1) {
    if (c + 1 - b < 0) {
      cout << "No" << endl;
      return;
    } else {
      cout << "Yes" << endl;
      return;
    }
  } else {
    long long e = gcd(b, d);
    start = a - ((a - (c + 1)) / e) * e;
    if (start - b < 0) {
      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;
}
