#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main() {
  ll T;
  cin >> T;
  for (ll query = 0; query < T; query++) {
    ll A, B, C, D;
    cin >> A >> B >> C >> D;
    if (B > D) {
      cout << "No\n";
      continue;
    }
    if (A > C) {
      ll kaisu = (A - C) / B + !!((A - C) % B);
      A -= kaisu * B;
    } else {
      A -= B;
    }
    if (A < 0) {
      cout << "No\n";
      continue;
    }
    A = C - A;
    ll up = (D - B) % B;
    if (D == B || !up) {
      cout << "Yes\n";
    } else if ((C - A % up + D) - 2 * B < 0) {
      cout << "No\n";
    } else {
      cout << "Yes\n";
    }
  }
  return 0;
}
