#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int main() {
  int t;
  cin >> t;
  for (int loop = 0; loop < t; loop++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool ok = true;
    if (a < b) ok = false;
    if (d < b) ok = false;
    if (!ok) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b - 1) {
      cout << "Yes" << endl;
      continue;
    }
    long long henka = d - (d - 1) / b * b;
    henka = b - (b - 1) / henka * henka;
    long long tmp = (a - b) / henka;
    long long hikaku = a - henka * tmp;
    if (hikaku - henka <= c)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
