#include <bits/stdc++.h>
using namespace std;
static const long long maxLL = (long long)1 << 62;
long long int a[333], b[333], c[333], d[333];
bool solve(int i) {
  if (a[i] < b[i] || d[i] < b[i]) return false;
  if (b[i] - c[i] == 1) return true;
  int cnt = a[i] % b[i];
  for (int j = 0; j < 100; j++) {
    cnt %= b[i];
    if (c[i] < cnt && cnt << b[i]) return false;
    if (cnt <= c[i]) cnt += d[i] % b[i];
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i] >> b[i] >> c[i] >> d[i];
  for (int i = 0; i < n; i++) {
    if (solve(i))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
