#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
int main() {
  int T, mod, mod2, mod3;
  cin >> T;
  long a[T], b[T], c[T], d[T];
  for (int i = 0; i < T; i++) {
    cin >> a[i];
    cin >> b[i];
    cin >> c[i];
    cin >> d[i];
  }
  for (int i = 0; i < T; i++) {
    mod = a[i] % b[i];
    mod2 = d[i] % b[i];
    if (a[i] < b[i]) {
      cout << "No" << endl;
    } else if (mod > c[i]) {
      cout << "No" << endl;
    } else {
      if (mod + d[i] < b[i]) {
        cout << "No" << endl;
      } else {
        mod3 = (mod + mod2) % b[i];
        while (1) {
          if (mod3 > c[i]) {
            cout << "No" << endl;
            break;
          } else if (mod3 == mod) {
            cout << "Yes" << endl;
            break;
          }
          mod3 = (mod3 + mod2) % b[i];
        }
      }
    }
  }
}
