#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long LINF = long long(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1},
          Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long t;
bool func(long long a, long long b, long long g, long long d) {
  long long x = a % g + ((b - a % g) / g + 1) * g;
  if (x < d)
    return false;
  else
    return true;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    long long kouyaku = gcd(b, d);
    if (func(a, c, kouyaku, b))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
