#include <bits/stdc++.h>
using namespace std;
int t;
long long a, b, c, d;
map<long long, bool> ta;
bool solve() {
  ta.clear();
  for (int i = 0; i < 1000000; i++) {
    if (a < b) return 0;
    if (b >= c) {
      a = a % b;
      if (a <= c) a += d;
    } else {
      if (a <= c) {
        a -= b;
        if (a < 0) return 0;
        a += d;
      } else {
        long long z = (a - c) / b;
        if ((a - c) % b) z++;
        a -= z * b;
        if (a < 0) return 0;
        if (a > c) cout << "WA";
        a += d;
      }
    }
  }
  return 1;
}
int main() {
  cin >> t;
  for (int iii = 0; iii < t; iii++) {
    cin >> a >> b >> c >> d;
    cout << (solve() ? "Yes" : "No") << endl;
  }
  return 0;
}
