#include <bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  if (a < b) {
    unsigned long long int tmp = a;
    a = b;
    b = tmp;
  }
  unsigned long long r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int main() {
  int T;
  cin >> T;
  bool is_ok[T];
  unsigned long long int A, B, C, D, R;
  for (int i = 0; i < T; i++) {
    is_ok[i] = false;
    cin >> A >> B >> C >> D;
    if (D < B) continue;
    if (C < A % B) continue;
    unsigned long long E = gcd(B, D);
    if (C / E < B / E - 1) continue;
    is_ok[i] = true;
  }
  for (int i = 0; i < T; i++)
    if (is_ok[i])
      cout << "Yes" << std::endl;
    else
      cout << "No" << std::endl;
  return 0;
}
