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