#include <bits/stdc++.h>
using namespace std;
const int bigmod = 1000000007;
const int INF = 1050000000;
const long long INFll = 100000000000000000;
long long gcd(long long a, long long b) {
  if (a < 0) a = -a;
  if (b < 0) b = -b;
  if (a < b) {
    swap(a, b);
  }
  long long r = 1;
  while (r != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  int T;
  cin >> T;
  for (int(i) = 0; (i) < (T); (i)++) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B || A % B > C || B > D) {
      cout << "no" << endl;
      continue;
    }
    if (B == D) {
      cout << "yes" << endl;
      continue;
    }
    if (B - C >= 1 || D % B == 0) {
      cout << "yes" << endl;
      continue;
    }
    long long G = gcd(D % B, B);
    if (G == 1) {
      cout << "no" << endl;
      continue;
    } else {
      if (A > C) {
        A = A % B;
      }
      long long n = (C - A) / G;
      long long check = A + n * G;
      if (check < B) {
        cout << "no" << endl;
      } else {
        cout << "yes" << endl;
      }
    }
  }
  return 0;
}
