#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000009;
const long long INFLL = 0x1f1f1f1f1f1f1f1fLL;
template <class A, class B>
inline ostream& operator<<(ostream& st, const pair<A, B>& P) {
  return st << "(" << P.first << "," << P.second << ")";
};
template <class A, class B>
inline pair<A, B> operator+(const pair<A, B>& P, const pair<A, B>& Q) {
  return pair<A, B>(P.first + Q.first, P.second + Q.second);
};
template <class A, class B>
inline pair<A, B> operator-(const pair<A, B>& P, const pair<A, B>& Q) {
  return pair<A, B>(P.first - Q.first, P.second - Q.second);
};
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
bool solve(long long a, long long b, long long c, long long d) {
  if (b > a) {
    return false;
  }
  if (b > d) {
    return false;
  }
  if (d % d == 0) {
    if (a % b <= c) {
      return true;
    } else {
      return false;
    }
  }
  a %= b;
  if (a < b) a += b;
  d %= b;
  if (d < b) d += b;
  long long g = gcd(gcd(gcd(a, b), c), d);
  a /= g;
  b /= g;
  c /= g;
  d /= g;
  if (b - 1 <= c) return true;
  return false;
  return true;
}
int main() {
  int T;
  cin >> T;
  vector<bool> ret(T);
  for (int t = 0; t < T; t++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    ret[t] = solve(a, b, c, d);
    cout << (ret[t] ? "Yes" : "No") << endl;
  }
}
