#include <bits/stdc++.h>
using namespace std;
bool check(long long a, long long b, long long c, long long d) {
  if (a < b || d < b) return false;
  if (c >= b) return true;
  long long cur = a - ((a - c) / b) * b;
  set<long long> s;
  while (true) {
    if (cur < 0) return false;
    if (s.count(cur) != 0) {
      return true;
    }
    s.insert(cur);
    if (cur <= c) {
      cur += d;
      cur -= ((cur - c - b) / b) * b;
    }
    s.insert(cur);
    cur -= b;
  }
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (check(a, b, c, d)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
