#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
int T;
long long a, b, c, d, t, del, _del;
inline bool solve() {
  cin >> a >> b >> c >> d;
  if (a < b || d < b) return 0;
  if (c > a) {
    a = (c - a) / (d - b) * (d - b);
    if (a < c) a += d - b;
  } else
    a -= (a - c) / b * b;
  if (b == d) return a >= b;
  d = d % b + b + b;
  bool ans = 1;
  for (int i = 1; i <= 300000; i++) {
    a += (c - (a - b)) / (d - b) * (d - b);
    if (a - b <= c) a += d - b;
    a -= b;
    ans &= (a >= b);
  }
  return ans;
}
int main() {
  cin >> T;
  while (T--) puts(solve() ? "Yes" : "No");
  return 0;
}
