#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
bool solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a < b) return false;
  if (d < b) return false;
  if (b <= c && d >= c) return true;
  a -= max(0LL, (a - c - 1) / b) * b;
  d -= max(0LL, (d - c - 1) / b) * b;
  set<long long> st;
  int cnt = 0;
  while (a >= b) {
    cnt++;
    if (cnt >= 10000) break;
    if (st.count(a)) return true;
    st.insert(a);
    a -= b;
    if (a <= c) a += d;
  }
  long long g = gcd(b, d);
  a %= g;
  long long x = max(0LL, (c % b - a % g + g - 1) / g);
  return a % g + g * x < b;
}
int main() {
  int T;
  cin >> T;
  for (int i = 1; i <= T; i++) {
    cout << (solve() ? "Yes" : "No") << endl;
  }
}
