#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  int T;
  cin >> T;
  for (int i = 0; i < T; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (B > A || D > A) {
      cout << "No" << endl;
    } else if (B <= C) {
      cout << "Yes" << endl;
    } else {
      long long g = gcd(B, D);
      if (B - g + A % g > C)
        cout << "No" << endl;
      else
        cout << "Yes" << endl;
    }
  }
}
