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