#include <bits/stdc++.h>
using namespace std;
void yes() { cout << "Yes\n"; }
void no() { cout << "No\n"; }
void solve() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a < b || d < b) return no();
  if (c >= b) return yes();
  long long x = a / b, y = (a - c - 1) / b;
  if (x <= y) return no();
  long long k = (a - c + b - 1) / b;
  a -= k * b;
  long long delta = d - b;
  if (delta == 0) return yes();
  x = (c + delta) / delta;
  y = (b - 1) / delta;
  if (x <= y) return no();
  return yes();
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
}
