#include <bits/stdc++.h>
using namespace std;
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 (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (D < B) {
      cout << "No" << endl;
      continue;
    }
    if (C + 1 >= B) {
      cout << "Yes" << endl;
      continue;
    }
    long long d = D % B;
    if (d == 0) {
      if (A % B >= C + 1) {
        cout << "No" << endl;
        continue;
      } else {
        cout << "Yes" << endl;
        continue;
      }
    }
    long long x = C + 1 - (A % B);
    long long y = B - 1 - (A % B);
    if (x % d == 0 || x <= 0) {
      cout << "No" << endl;
      continue;
    }
    if (x / d == y / d) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
