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