#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double PI = acos(-1.0);
const double MOD = 1e9 + 7;
using ll = long long;
int main(void) {
  int t;
  cin >> t;
  ll a[t], b[t], c[t], d[t];
  for (int64_t i = (int64_t)(0); i < (int64_t)(t); i++)
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  for (int64_t j = (int64_t)(0); j < (int64_t)(t); j++) {
    int f = 0;
    ll limit = 0L;
    ll store = a[j];
    ll diff = d[j] - b[j];
    if (diff < 0) {
      std::cout << "No" << std::endl;
      continue;
    }
    if (a[j] - b[j] < 0) {
      std::cout << "No" << std::endl;
      continue;
    }
    store = store + c[j] * (c[j] / b[j]);
    for (int64_t i = (int64_t)(0); i < (int64_t)(10000); i++) {
      store = store % b[j];
      if (store <= c[j]) store = store + d[j];
      if (store < b[j]) {
        std::cout << "No" << std::endl;
        f = 1;
        break;
      }
    }
    if (!f) std::cout << "Yes" << std::endl;
  }
  return 0;
}
