#include <bits/stdc++.h>
using namespace std;
template <typename X>
bool exist(vector<X> vec, X item) {
  return find(vec.begin(), vec.end(), item) != vec.end();
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long T;
  cin >> T;
  for (long long i = (long long)0; i < (long long)T; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (d < b) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    long long rangefrom = c + 1 - (a % b);
    long long rangeto = b - 1 - (a % b);
    long long ans = 0;
    if (d % b != 0) ans = (rangefrom - 1) / (d % b);
    ans *= (d % b);
    if (ans < rangefrom) ans += (d % b);
    cerr << rangefrom << "----" << ans << "----" << rangeto << endl;
    if (rangefrom <= ans && ans <= rangeto)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
