#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t) {
    --t;
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No";
    } else {
      if (c >= b - 1) {
        cout << "Yes";
      } else {
        a = a % b;
        if (a > c) {
          cout << "No";
        } else if (gcd(d, b) == b) {
          cout << "Yes";
        } else {
          long long r = (d - b) % b;
          a = a % b;
          long long x1 = (c - a) / r, x2 = (b - 1 - a) / r;
          if (x1 == x2)
            cout << "Yes";
          else
            cout << "No";
        }
      }
    }
    cout << "\n";
  }
}
