#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    a -= b;
    if (a < 0) {
      cout << "No" << endl;
      continue;
    }
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b - 1) {
      cout << "Yes" << endl;
      continue;
    }
    a = a % b;
    if (a > c) {
      cout << "No" << endl;
      continue;
    }
    long long p = d % b;
    long long q = gcd(d, b);
    long long z1, z2;
    z1 = (c - a) / q + 1;
    z2 = (b - a) / q - 1;
    if (z1 <= z2) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
