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