#include <bits/stdc++.h>
using namespace std;
int inf = 1 << 30;
int main() {
  int T;
  cin >> T;
  long long A[T];
  long long B[T];
  long long C[T];
  long long D[T];
  for (int i = 0; i < (int)(T); i++) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
    bool a = false;
    bool c = false;
    long long diff = (D[i] - B[i]);
    if (diff > 0) {
      a = (D[i] % diff) == 0;
      long long init = A[i] - B[i];
      for (long long j = init;; j += diff) {
        if (j > C[i]) {
          c = j < B[i];
          break;
        }
      }
    }
    long long ones = A[i] - ((A[i] - C[i] - 1) / B[i]) * B[i];
    if (A[i] < B[i]) {
      cout << "No" << endl;
    } else if (D[i] < B[i]) {
      cout << "No" << endl;
    } else if (D[i] == B[i]) {
      cout << "Yes" << endl;
    } else if ((C[i] + 1 < B[i] && c)) {
      cout << "No" << endl;
    } else if ((ones - B[i] < 0)) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
