#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int INF = (int)1e9;
const long long inf = (long long)1e18;
const long long MOD{(long long)1e9 + 7};
long long A, B, C, D;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
bool judge() {
  if (A < B) return false;
  if (B > D) return false;
  if (B <= C) return true;
  long long g = gcd(B, D);
  return B - g + (A % g) <= C;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> A >> B >> C >> D;
    if (judge()) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
