#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
long long GCD(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return GCD(b, a % b);
}
bool solve() {
  if (a < b) return false;
  if (d < b) return false;
  if (c >= b - 1) return true;
  long long g = GCD(b, d);
  a %= g;
  long long Max = (b - a % g + g - 1) / g * g - g;
  if (Max > c)
    return false;
  else
    return true;
}
int main() {
  int T;
  cin >> T;
  for (int CASE = 0; CASE < T; ++CASE) {
    cin >> a >> b >> c >> d;
    if (solve())
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
