#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  long long A, B, C, D;
  for (long long i = (0); i < (T); i++) {
    cin >> A >> B >> C >> D;
    if (B > D || A < B || A % B > C) {
      cout << "No" << endl;
      continue;
    }
    long long ans = A % B;
    long long ka = (ans + D) % B - ans;
    if (ka == 0) {
      cout << "Yes" << endl;
      continue;
    }
    long long w = C / ka * ka + ka;
    if (C < w && w < B)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
