#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int t;
  long long int a[300], b[300], c[300], d[300];
  cin >> t;
  for (long long int i = 0; i < t; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (long long int i = 0; i < t; i++) {
    if (a[i] < b[i] || d[i] < b[i]) {
      std::cout << (false ? "Yes" : "No") << endl;
      continue;
    } else if (b[i] - c[i] <= 1) {
      std::cout << (true ? "Yes" : "No") << endl;
      continue;
    }
    a[i] %= b[i];
    if (a[i] < b[i] && a[i] > c[i]) {
      std::cout << (false ? "Yes" : "No") << endl;
      continue;
    } else if ((d[i] - b[i]) % b[i] == 0) {
      std::cout << (true ? "Yes" : "No") << endl;
      continue;
    }
    if (((c[i] / (d[i] - b[i])) * (d[i] - b[i]) + a[i] % (d[i] - b[i]) < b[i] &&
         (c[i] / (d[i] - b[i])) * (d[i] - b[i]) + a[i] % (d[i] - b[i]) >
             c[i]) ||
        ((c[i] / (d[i] - b[i]) + 1) * (d[i] - b[i]) + a[i] % (d[i] - b[i]) <
             b[i] &&
         (c[i] / (d[i] - b[i]) + 1) * (d[i] - b[i]) + a[i] % (d[i] - b[i]) >
             c[i])) {
      std::cout << (false ? "Yes" : "No") << endl;
      continue;
    } else {
      std::cout << (true ? "Yes" : "No") << endl;
      continue;
    }
  }
  return 0;
}
