#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20);
  long long q;
  cin >> q;
  while (q--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No\n";
      continue;
    }
    if (b <= c) {
      cout << "Yes\n";
      continue;
    }
    long long g = gcd(b, d);
    long long t = (b - a % g + g - 1) / g * g + a % g - g;
    if (c > t) {
      cout << "Yes\n";
    } else
      cout << "No\n";
  }
}
