#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main(int argc, char** argv) {
  int T;
  cin >> T;
  while (T--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long p = gcd(b, d);
    a = a % b;
    long long e = ((c - a) / p) * p + a;
    if (e <= c) e += p;
    if (e < b)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
