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