#include <bits/stdc++.h>
using namespace std;
long long gcd(long long n, long long m) {
  if (m == 0)
    return n;
  else
    return gcd(m, n % m);
}
int main() {
  long long n, a, b, c, d, ok;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    long long x = gcd(b, d);
    long long y = ((d - b) % d + d) % d;
    if (b == d)
      ok = a % d;
    else
      ok = a % d % (d - b) + d - x - y;
    if (a < b || d < b)
      cout << "No" << endl;
    else if (c >= b)
      cout << "Yes" << endl;
    else if (c >= ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
