#include <bits/stdc++.h>
using namespace std;
int to_int(string s) { return atoi(s.c_str()); }
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No" << endl;
      continue;
    }
    if (a >= b && c >= b && d >= b) {
      cout << "Yes" << endl;
      continue;
    }
    if (d == b) {
      if (a % b <= c) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
      continue;
    }
    long long int init = a % b;
    if (c < init) {
      cout << "No" << endl;
      continue;
    }
    long long int m = (c - init) % (d - b);
    if ((c - m + d - b) < b) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}
