#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
constexpr char ln = '\n';
const int mx = 200010;
const long long mod = 1e9 + 7;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  int q;
  cin >> q;
  while (q--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > a) {
      cout << "No" << ln;
      continue;
    }
    if (b > d) {
      cout << "No" << ln;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << ln;
      continue;
    }
    long long g = gcd(b, d);
    long long tmp = a % b + b - g;
    if (tmp > c) {
      cout << "No" << ln;
      continue;
    }
    cout << "Yes" << ln;
  }
  return 0;
}
