#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000000000LL;
const long long NMAX = 1e6 + 4;
const long long mod = 1e9 + 7;
const double eps = 1e-10;
const double PI = acos(-1);
long long gcd(long long a, long long b) { return a == 0 ? b : gcd(b % a, a); }
signed main() {
  ios::sync_with_stdio(false);
  long long T;
  cin >> T;
  for (long long _ = (0); _ < (T); _++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    long long g = gcd(B, D);
    long long c = C - C % g;
    long long a = c + A % g;
    if (a <= C) a += g;
    if (D < B) {
      cout << "No" << endl;
      continue;
    }
    if (a < B)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
}
