#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long double PI = acos(-1.0L);
const long long MOD = 1000000007LL;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int T;
  cin >> T;
  while (T--) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (B > A || B > D) {
      cout << "No" << endl;
      continue;
    }
    if (C + 1LL >= B) {
      cout << "Yes" << endl;
      continue;
    }
    long long E = A % B, F = D - B;
    bool ok = true;
    if (D == B) {
      if (C < E) ok = false;
    } else if (C - E < 0)
      ok = false;
    else {
      if ((C - E) / F + 1LL <= (B - E - 1LL) / F) ok = false;
    }
    cout << (ok ? "Yes" : "No") << endl;
  }
}
