#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int query = 0; query < t; ++query) {
    bool ok = true;
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || c + d < b) {
      cout << "No" << endl;
      continue;
    }
    unordered_set<long long> amaris;
    while (true) {
      long long amari = a % b;
      auto is_new_amari = amaris.insert(amari);
      if (!is_new_amari.second) {
        break;
      }
      a -= ((a - c - 1) / b + 1) * b;
      if (a < 0) {
        ok = false;
        break;
      } else {
        a += d;
      }
    }
    if (ok) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
