#include <bits/stdc++.h>
using namespace std;
bool calc(long long int A, long long int B, long long int C, long long int D) {
  if (A < B) return false;
  if (D >= B && C >= B) return true;
  long long int cur = A;
  bool ok = true;
  for (int i = 0; i < 20000; i++) {
    cur = cur % B;
    if (cur <= C) cur += D;
    if (cur < B) {
      ok = false;
      break;
    }
  }
  return ok;
}
int main(void) {
  long long int A, B, C, D;
  int T;
  cin >> T;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    if (calc(A, B, C, D))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
