#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool solve(ll a, ll b, ll c, ll d) {
  if (b <= c + 1) return true;
  if (a < b) return false;
  if (b > d) return false;
  ll x = a % b;
  ll y = d % b;
  if (y) {
    c = c - x;
    b = b - x;
    if (c % y) {
      return !(c / y < b / y);
    } else {
      return !(c / y + 1 < b / y);
    }
  } else {
    return x <= c || x >= b;
  }
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if (solve(a, b, c, d)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
