#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
int main() {
  int T;
  cin >> T;
  vector<vector<ll>> vec = vector<vector<ll>>(T, vector<ll>(4, 0));
  ll A, B, C, D;
  ll a, b;
  for (ll i = 0; i < (ll)T; i++) {
    cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      cout << "No" << endl;
    } else if (B <= C) {
      cout << "Yes" << endl;
    } else {
      a = A % B;
      b = (A + D) % B;
      while (true) {
        if (C < b) {
          cout << "No" << endl;
          break;
        }
        if (a == b) {
          cout << "Yes" << endl;
          break;
        }
        b = (b + D) % B;
      }
    }
  }
}
