#include <bits/stdc++.h>
using namespace std;
inline bool solve(long long int a, long long int b, long long int c,
                  long long int d) {
  if (a < b) {
    return false;
  }
  if (b > d) {
    return false;
  }
  long long int plus = d % b;
  long long int now = a;
  for (long long int i = 0; i < ((long long int)(500000)); i++) {
    now = (now + plus) % b;
    if (now < b && now > c) {
      return false;
    }
  }
  return true;
}
int main() {
  long long int n;
  cin >> n;
  for (long long int i = 0; i < ((long long int)(n)); i++) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << (solve(a, b, c, d) ? "Yes" : "No") << endl;
  }
  return 0;
}
