#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("tune=native")
#pragma GCC target("avx")
using namespace std;
const int mod = 1000000009;
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (a % b) {
    return gcd(b, a % b);
  } else {
    return b;
  }
}
int t;
long long a, b, c, d;
int main() {
  scanf("%d", &(t));
  for (int _ = 0; _ < (t); _++) {
    scanf("%lld", &(a));
    scanf("%lld", &(b));
    scanf("%lld", &(c));
    scanf("%lld", &(d));
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    long long dgcd = gcd(b, d);
    a %= b;
    a += b;
    while (a >= b) a -= dgcd;
    if (d >= b && c >= a) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
