#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const double PI = 3.14159265359;
void check(long long a, long long b, long long c, long long d) {
  if (a < b || d < b) {
    cout << "No" << endl;
    return;
  }
  if (c >= b) {
    cout << "Yes" << endl;
    return;
  }
  set<long long> visited;
  long long cur = a;
  while (1) {
    long long next = cur - b * ((cur - b) / b);
    if (next >= b) next -= b;
    if (next > c) {
      cout << "No" << endl;
      return;
    }
    next += d;
    if (visited.find(next) != visited.end()) {
      cout << "Yes" << endl;
      return;
    }
    visited.insert(next);
    cur = next;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  while (n--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    check(a, b, c, d);
  }
  return 0;
}
