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