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