#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e15;
const long long int MOD = 1e9 + 7;
long long int gcd(long long int a, long long int b) {
  if (a < b) {
    swap(a, b);
  }
  long long int r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
signed main() {
  long long int n;
  cin >> n;
  for (long long int i = 0; i < (n); ++i) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    }
    if (b <= c) {
      cout << "Yes" << endl;
      continue;
    }
    a %= b;
    long long int g = gcd(b, d);
    a = b - g + a % g;
    if (a > c) {
      cout << "No" << endl;
    }
    cout << "Yes" << endl;
  }
  return 0;
}
