#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const string YES = "Yes";
const string NO = "No";
void solve(long long int a, long long int b, long long int c, long long int d) {
  if (b > d) {
    cout << NO << endl;
    return;
  }
  if (a - b < 0) {
    cout << NO << endl;
    return;
  }
  if (d % b == 0) {
    if (a % b <= c) {
      cout << YES << endl;
    } else {
      cout << NO << endl;
    }
    return;
  }
  long long int pl = d % b;
  long long int cnt = b - a % b;
  if (0)
    cout << "cnt"
         << "=" << cnt << " "
         << "pl"
         << "=" << pl << endl;
  ;
  long long int maxNum = ((cnt - 1) / pl) * pl + a % b;
  if (0)
    cout << "a"
         << "=" << a << " "
         << "b"
         << "=" << b << " "
         << "c"
         << "=" << c << " "
         << "d"
         << "=" << d << endl;
  ;
  if (0)
    cout << "maxNum"
         << "=" << maxNum << " "
         << "c"
         << "=" << c << endl;
  ;
  if (maxNum <= c) {
    cout << YES << endl;
  } else {
    cout << NO << endl;
  }
}
int main() {
  long long T;
  scanf("%lld", &T);
  for (int i = 0; i < T; i++) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    solve(a, b, c, d);
  }
  return 0;
}
