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