#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
ll gcd(ll a, ll b) {
  ll tmp;
  while (0 != b) {
    tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > a || b > c + d) {
      cout << "No" << endl;
      continue;
    }
    ll g = gcd(b, d);
    if (b - g + a % g < c) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
  return 0;
}
