#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long c;
  if (a < b) {
    a += b;
    b = a - b;
    a -= b;
  }
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}
int main() {
  long T;
  cin >> T;
  long long* A = new long long[T];
  long long* B = new long long[T];
  long long* C = new long long[T];
  long long* D = new long long[T];
  bool* result = new bool[T];
  for (int i = 0; i < T; i++) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
    long long firstA = A[i];
    vector<long long> history;
    long long x = gcd(B[i], D[i]);
    if (A[i] % B[i] + ((B[i] - A[i] % B[i] - 1) / x) * x >= C[i]) {
      result[i] = false;
      cout << "No" << endl;
    } else {
      result[i] = true;
      cout << "Yes" << endl;
    }
  }
  return 0;
}
