#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  for (int i = 0; i < T; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    bool ok = 0;
    if (B > A || B > D) {
      ok = 0;
    } else if (B <= C) {
      ok = 1;
    } else if (A % B > C) {
      ok = 0;
    } else if (D % B == 0) {
      ok = 1;
    } else if (D % B < B - C) {
      ok = 0;
    } else {
      long long d = D % B;
      A %= B;
      long long q = (B - A + d - 1) / d;
      if (C - (B - d) >= (A - (B - d * q) + d) % d) {
        ok = 1;
      } else {
        ok = 0;
      }
    }
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
