#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
signed main() {
  long long T;
  cin >> T;
  while (T--) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      cout << "NO" << endl;
    } else if (C < B - gcd(B, D) - A % gcd(B, D)) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}
