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