#include <bits/stdc++.h>
using namespace std;
const long long INF = numeric_limits<long long int>::max();
const long long MOD = 1000000007;
const long double PI = 3.1415926;
template <class T>
T &chmin(T &a, const T &b) {
  return a = min(a, b);
}
template <class T>
T &chmax(T &a, const T &b) {
  return a = max(a, b);
}
long long int n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  long long int T;
  cin >> T;
  for (long long int i = (long long int)(0); i < (long long int)(T); i++) {
    long long int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B || A - B + D < B || B > D) {
      cout << "No" << endl;
      continue;
    }
    if (B == D) {
      if (A - B > C && A - B < B)
        cout << "No" << endl;
      else
        cout << "Yes" << endl;
      continue;
    }
    bool ok = true;
    long long int test = gcd(B, D - B);
    long long int start = llabs(A - B + 1);
    long long int end = llabs(A - C - 1);
    if (end - start == 0) {
      if (start % test == 0 || end % test == 0 || start != end) {
        ok = false;
      }
    }
    if (ok)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
