#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int tt;
  cin >> tt;
  long long a, b, c, d, cur, x, y;
  set<long long> endOfDay;
  for (int t = 0; t < tt; t++) {
    cin >> a >> b >> c >> d;
    if (b > a)
      cout << "No" << endl;
    else if (d < b)
      cout << "No" << endl;
    else {
      cur = a;
      bool loop = true;
      while (endOfDay.find(cur) == endOfDay.end()) {
        if (cur < b) loop = false;
        endOfDay.emplace(cur);
        x = cur % b;
        y = (c - x) / b + (x > c ? 0 : 1);
        cur = x + y * d;
      }
      cout << (loop ? "Yes" : "No") << endl;
      endOfDay.clear();
    }
  }
  return 0;
}
