#include <bits/stdc++.h>
using namespace std;
double dat[100][100];
int dp[1000001];
int prime[1000001];
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  long a, b, c, d;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    long long g = gcd(b, d);
    a = a % b;
    long long k = (b - a) / g;
    if ((b - a) % g == 0) k--;
    if (a + k * g > c) {
      cout << "No" << endl;
      continue;
    } else
      cout << "No" << endl;
  }
  return 0;
}
