#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int m, long long int n) {
  return (m % n == 0) ? n : gcd(n, m % n);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long int T, A, B, C, D;
  cin >> T;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      cout << "No"
           << "\n";
    } else {
      if (C >= B - 1) {
        cout << "Yes"
             << "\n";
      } else {
        long long int d = gcd(B, D);
        if (B - d + A % d >= C - 1) {
          cout << "No"
               << "\n";
        } else {
          cout << "Yes"
               << "\n";
        }
      }
    }
  }
}
