#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool coY() { cout << "Yes" << endl; }
bool coN() { cout << "No" << endl; }
const ll INF = 1LL << 60;
ll n, m;
string s;
const int mod = 1e9 + 7;
int main() {
  cout << setprecision(10);
  cin >> n;
  ll a, b, c, d;
  for (int i = (0); i < (n); ++i) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      coN();
    } else if (b > d) {
      coN();
    } else if (b == d) {
      ll tenjou = ((a - c) + (b - 1)) / b;
      if (a - tenjou * b >= 0 && a - tenjou * b <= c) {
        coY();
      } else {
        coN();
      }
    } else {
      ll up = d - b;
      ll def = a - b * ((a - c + b - 1) / b);
      if (def < 0) {
        coN();
        continue;
      }
      ll kdush = (c - def + up - 1) / up;
      if ((c - def) % up == 0) {
        kdush++;
      }
      if (def + kdush * up - b >= 0) {
        coY();
      } else {
        coN();
      }
    }
  }
}
