#include <bits/stdc++.h>
using namespace std;
signed main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long T;
  cin >> T;
  for (long long i = 0; i < T; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B || B > D) {
      cout << "No" << endl;
      continue;
    }
    if (D == B) {
      A = A % B;
      if (A > C) A -= B;
    } else {
      long long k = (B + C - A + (D - B - 1)) / (D - B);
      k = max(0LL, k);
      A = A + k * (D - B);
      if (D - B == 1) A = B + C + 1;
    }
    if (C < A % B || A < 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
