#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e7 + 100;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  int i, j;
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (d - b < 0) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    long long g = gcd(b, d);
    a = a % b;
    long long k = (b - a) / g;
    if (!(b - a) % g) --k;
    if (a + k * g > c) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
  return 0;
}
