#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > d || a < b) {
      cout << "No\n";
    } else {
      long long x = a;
      if (x > c) {
        long long k = (x - c + b - 1) / b;
        x -= k * b;
      }
      if (x >= 0 && b != d) {
        long long k = (c - x + d - b) / (d - b);
        x += k * (d - b);
      }
      if (x < 0 || x > c && x < b) {
        cout << "No\n";
      } else {
        cout << "Yes\n";
      }
    }
  }
  return 0;
}
