#include <bits/stdc++.h>
using namespace std;
const int lmax = 1999999999;
const long long lmx = 1999999999999999999;
int t;
long long a, b, c, d;
int main() {
  std::ios::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    a -= b;
    if (a >= 0 && a <= c) a += d;
    if (a <= c && d < b) {
      cout << "No" << endl;
      continue;
    }
    if (a >= b && d >= b && c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    bool ok = 1;
    int p = 0;
    long long A = a;
    a %= b;
    if (c / b * b + a > c) {
      a = c / b * b + a;
    } else {
      a = (c / b + 1) * b + a;
    }
    for (int i = 1; i <= 1000000; i++) {
      if (a < b) {
        cout << "No" << endl;
        ok = 0;
        break;
      }
      a %= b;
      if (c / b * b + a > c) {
        a = c / b * b + a;
      } else {
        a = (c / b + 1) * b + a;
      }
      a -= b;
      if (a <= c && a >= 0) a += d;
    }
    if (!ok) continue;
    cout << "Yes" << endl;
  }
}
