#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int m, long long int n) {
  if (0 == m || 0 == n) return 0;
  while (m != n) {
    if (m > n)
      m = m - n;
    else
      n = n - m;
  }
  return m;
}
int main() {
  int t;
  cin >> t;
  long long int a, b, c, d;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (b > a) {
      cout << "No" << endl;
      continue;
    }
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    if (b <= c) {
      cout << "Yes" << endl;
      continue;
    }
    long long int x = gcd(b, d);
    long long int y = b - x + (a % x);
    if (y < c) {
      cout << "Yes" << endl;
      continue;
    } else if (y >= c) {
      cout << "No" << endl;
      continue;
    }
    cout << i << endl;
    return 1;
  }
}
