#include <bits/stdc++.h>
using namespace std;
long long gcd(long long n, long long m) {
  if (m == 0) return n;
  return gcd(m, n % m);
}
signed main(void) {
  long long i, j;
  long long n;
  cin >> n;
  for (i = 0; i < (n); i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool ans = true;
    if (a < b)
      ans = false;
    else if (b > d)
      ans = false;
    else if (b - 1 <= c)
      ans = true;
    else {
      long long l = (c + 1 - a + b) % b;
      long long r = (b - 1 - a + b) % b;
      long long g = gcd(b, d);
      if (l <= r && (l / g != r / g || l % g == 0)) ans = false;
    }
    if (ans)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
