#include <bits/stdc++.h>
using namespace std;
constexpr auto INF = INT_MAX >> 1;
constexpr auto LINF = 5000000000000000;
constexpr auto MOD = 1000000007;
long long gcd(long long i, long long j) { return i % j ? gcd(j, i % j) : j; }
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < (t); i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > d || a < b) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    long long x = (a - c) % b;
    if (!x) x = b;
    if (x + c - b < 0) {
      cout << "No" << endl;
      continue;
    }
    long long y = (x + d - b - c) % b;
    if (!y) y = b;
    if (x == y) {
      cout << "Yes" << endl;
      continue;
    }
    long long z = gcd(b, abs(x - y));
    x %= z;
    if (!x) x = z;
    if (c + x - b >= 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
