#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int gcd(int b, int d) {
  int r;
  if (b < d) swap(b, d);
  while (d > 0) {
    r = b % d;
    b = d;
    d = r;
  }
  return b;
}
signed main() {
  int T;
  cin >> T;
  for (int q = 0; q < T; q++) {
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B || B > D) {
      cout << "No" << endl;
      continue;
    } else if (C >= B) {
      cout << "Yes" << endl;
      continue;
    }
    int g = gcd(B, D);
    if (B - g + (A % g) > C) {
      cout << "No" << endl;
    } else
      cout << "Yes" << endl;
    continue;
  }
}
