#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll Mod = 1000000007;
void test_case() {
  ll A, B, C, D;
  cin >> A >> B >> C >> D;
  if (B > D) {
    cout << "No" << endl;
    return;
  }
  if (A < B) {
    cout << "No" << endl;
    return;
  }
  if (B == D) {
    ll z = (A - C + B - 1) / B;
    ll L = A - (z * B);
    ll second;
    if (A <= C) {
      second = A;
    } else {
      second = L;
    }
    if (D + second - B >= 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return;
  }
  ll E;
  ll first;
  if (A <= C) {
    E = A;
    ll y = (C - A + D - B) / (D - B);
    first = A + (y * (D - B));
  } else {
    ll x = (A - C + B - 1) / B;
    E = A - (x * B);
    first = E + D;
  }
  if (E < 0) {
    cout << "No" << endl;
    return;
  }
  ll G = D - (B * (D / B));
  ll H;
  if (G == 0) {
    H = first;
    if ((C + 1) - B + H >= 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    H = (first - 1) % G;
    if ((C + 1) - B + H >= 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return;
}
int main() {
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) {
    test_case();
  }
  return 0;
}
