#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, a, b, c, d;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    } else {
      if (b == d) {
        cout << (a % b <= c ? "Yes" : "No") << endl;
        continue;
      } else {
        if (b <= c) {
          cout << "Yes" << endl;
          continue;
        } else {
          vector<long long> s;
          long long tmp = a;
          while (true) {
            long long payoff = tmp % b + ceil(c / b) * b - b;
            if (payoff > c) {
              cout << "No" << endl;
              break;
            }
            vector<long long>::iterator it = find(s.begin(), s.end(), payoff);
            if (it != s.end()) {
              cout << "Yes" << endl;
              break;
            } else
              s.push_back(payoff);
            tmp = payoff + d;
          }
        }
      }
    }
  }
}
