#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
const long long M = 1e6 + 5;
const long long mod = 1e9 + 7;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No\n";
      continue;
    }
    a = a - (a / b - 1) * b;
    if (b + c - a < 0) {
      cout << "No\n";
      continue;
    }
    if (d == b) {
      if ((b + c - a) < 0 && (2 * b - a) > 0)
        cout << "No\n";
      else
        cout << "Yes\n";
      continue;
    }
    long long l = (b + c - a) / (d - b) + 1;
    long long r = (2 * b - a) / (d - b);
    if ((2 * b - a) % (d - b) == 0) r--;
    if (r - l >= 0)
      cout << "No\n";
    else
      cout << "Yes\n";
  }
}
