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