#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  long long a, b, c, d;
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    long long a1 = a % b, k = d - b;
    if (k == 0) {
      if (a1 > c) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
      continue;
    } else if (k < 0) {
      cout << "No" << endl;
      continue;
    }
    long long bb = a1 + (c - a1 + k - 1) / k * k;
    if ((c < bb && bb < b) || bb + k < b || bb + (2 * k) < b) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
}
