#include <bits/stdc++.h>
using namespace std;
int n;
long long a, b, c, d;
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int main() {
  cin >> n;
  while (n--) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    long long g = gcd(b, d);
    if ((a - c) / g - (a - b) / g > 0)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
