#include <bits/stdc++.h>
using namespace std;
int gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main(void) {
  int T;
  long long A, B, C, D;
  cin >> T;
  bool res[T];
  bool isOdd;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    long long memo = gcd(gcd(B, C), D);
    A /= memo;
    A -= memo;
    B /= memo;
    C /= memo;
    D /= memo;
    if (A < B || B > D) {
      res[i] = false;
      continue;
    }
    if (A % B <= C && (A % B + D) % B == A % B) {
      res[i] = true;
      continue;
    }
    if (B - C >= 2) {
      res[i] = false;
      continue;
    } else {
      res[i] = true;
      continue;
    }
  }
  for (int i = 0; i < T; i++) {
    if (res[i])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
