#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  for (int times = (0); times < (t); ++times) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    long long bfirst = A - (A - B + B - 1) / B * B;
    long long cfirst = A - (A - C + B - 1) / B * B;
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (D < B) {
      cout << "No" << endl;
      continue;
    } else if (D == B) {
      if (B > C) {
        if (bfirst > C && bfirst < B) {
          cout << "No" << endl;
          continue;
        } else {
          cout << "Yes" << endl;
          continue;
        }
      } else {
        cout << "Yes" << endl;
        continue;
      }
    } else {
      if (B > C) {
        if (bfirst > C && bfirst < B) {
          cout << "No" << endl;
          continue;
        } else if (bfirst + D - B >= B) {
          cout << "Yes" << endl;
          continue;
        } else if (B / (D - B) - (C - bfirst) / (D - B) >= 1) {
          cout << "No" << endl;
          continue;
        } else {
          cout << "Yes" << endl;
          continue;
        }
      } else {
        cout << "Yes" << endl;
        continue;
      }
    }
  }
}
