#include <bits/stdc++.h>
using namespace std;
int t;
long long a, b, c, d, A, B, mn, dif;
long long gcd(long long A, long long B) {
  if (!A) return B;
  if (!B) return A;
  return gcd(B, A % B);
}
int main() {
  cin >> t;
  for (int cnt = 1; cnt <= t; cnt++) {
    cin >> a >> b >> c >> d;
    if (b > d) {
      cout << "No\n";
      continue;
    }
    if (b > a) {
      cout << "No\n";
      continue;
    }
    if (a < c) {
      cout << "Yes\n";
      continue;
    }
    c++;
    A = (b - (a - c) % b) % b;
    dif = (d) % b;
    if (dif) {
      B = gcd(dif, b);
      mn = (((b - A) / dif) * dif + A) % b;
      if (mn != 0) mn = (mn + dif) % b;
    } else
      mn = A;
    if (c + mn - b >= 0)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
