#include <bits/stdc++.h>
using namespace std;
int main() {
  long long T;
  cin >> T;
  for (long long i = 0; i < T; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long sa = d - b;
    if (a < b || sa < 0) {
      cout << "No" << endl;
      continue;
    }
    if (sa == 0) {
      a = a - a / b * b;
      if (a <= c)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
      continue;
    }
    if ((a - a / b * b) > c && (a - a / b * b) < b) {
      cout << "No" << endl;
      continue;
    }
    bool flag = true;
    a = c / sa * sa;
    if (a + sa < b) {
      cout << "No" << endl;
      continue;
    }
    if (c + 1 > b) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
  return 0;
}
