#include <bits/stdc++.h>
using namespace std;
int gcd(long long v, long long b) {
  if (v > b) return gcd(b, v);
  if (v == b) return b;
  if (b % v == 0) return v;
  return gcd(v, b % v);
}
int main() {
  int t;
  cin >> t;
  for (int zz = 0; zz < (int)(t); ++zz) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool flag = 0;
    if (b > d) flag = 1;
    if (a < b) flag = 1;
    long long x = gcd(b, d);
    long long y = (a - c - 1) % x;
    if (c + 1 + y < b) flag = 1;
    if (flag) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
