#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  bool b[T];
  long long A, B, C, D, X, Y;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    if (A < B)
      b[i] = false;
    else if (B > D)
      b[i] = false;
    else if (C + 1 >= B)
      b[i] = true;
    else if (A < 2 * B && A - B > C)
      b[i] = false;
    else if (A % B > C)
      b[i] = false;
    else if (B == D)
      b[i] = true;
    else {
      X = D - B;
      Y = A % B;
      while (1) {
        if (X == 0) break;
        Y += X;
        if (Y > C) break;
      }
      if (Y < B)
        b[i] = false;
      else
        b[i] = true;
    }
  }
  for (int i = 0; i < T; i++) {
    if (b[i])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
