#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;
using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;
bool paircomp(const pair<ll, ll> &a, const pair<ll, ll> &b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
struct multi {
  ll first;
  ll second;
  ll third;
  multi(ll first, ll second, ll third)
      : first(first), second(second), third(third) {}
};
bool multicomp(const multi &a, const multi &b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll T;
  cin >> T;
  vl A(T), B(T), C(T), D(T);
  for (ll i = 0; i < (T); i++) cin >> A[i] >> B[i] >> C[i] >> D[i];
  for (ll i = 0; i < (T); i++) {
    if (A[i] < B[i]) {
      cout << "No" << endl;
      continue;
    } else if (D[i] < B[i]) {
      cout << "No" << endl;
      continue;
    } else if (C[i] >= B[i]) {
      cout << "Yes" << endl;
      continue;
    }
    ll po = ceil(((long double)A[i] - (long double)C[i]) / (long double)B[i]) *
            B[i];
    if (po > A[i]) {
      cout << "No" << endl;
      continue;
    }
    po = A[i] - po;
    ll yo = ceil(((long double)D[i] - (long double)C[i] + (long double)po) /
                 (long double)B[i]) *
            B[i];
    if (yo > po + D[i]) {
      cout << "No" << endl;
      continue;
    }
    if (D[i] % B[i] == 0) {
      cout << "Yes" << endl;
      continue;
    }
    po = po + D[i] - yo;
    if (((((C[i] - (po % B[i])) / (D[i] % B[i])) + 1) * (D[i] % B[i])) + po <
        B[i])
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
