#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  for (int i = 0; i < T; i++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      cout << "No" << endl;
      continue;
    } else if (C >= B - 1) {
      cout << "Yes" << endl;
      continue;
    } else {
      long long apple = A % B;
      if (C + 1 <= apple) {
        cout << "No" << endl;
        continue;
      }
      if ((D % B) == 0) {
        cout << "Yes" << endl;
        continue;
      } else if ((D % B) <= (B - 1 - C)) {
        cout << "No" << endl;
        continue;
      } else {
        apple = apple % (D % B);
        long long lower = (C + 1) % (D % B);
        long long upper = (B - 1) % (D % B);
        if (lower < upper) {
          if (lower <= apple && apple <= upper) {
            cout << "No" << endl;
            continue;
          } else {
            cout << "Yes" << endl;
            continue;
          }
        } else if (lower > upper) {
          if (lower <= apple || apple <= upper) {
            cout << "No" << endl;
            continue;
          } else {
            cout << "Yes" << endl;
            continue;
          }
        } else {
          if (apple == lower) {
            cout << "No" << endl;
            continue;
          } else {
            cout << "Yes" << endl;
            continue;
          }
        }
      }
    }
  }
  return 0;
}
