#include <bits/stdc++.h>
using namespace std;
mt19937_64 mt(time(0));
long long gcd(long long a, long long b) {
  if (a < b) swap(a, b);
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool solve(long long r, long long b, long long c, long long d) {
  if (r != 0 && r < b - c) return false;
  if (d <= b - c - 1) return false;
  long long tmp = gcd(b, d);
  if (tmp <= b - c - 1) return false;
  r = r % tmp;
  long long x = 1 - r;
  if (x < 0) x += b;
  long long y = b - c - 1 - r;
  if (y < 0) y += b;
  x = x / tmp;
  y = y / tmp;
  if (x != y) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(10);
  cout << fixed;
  long long a, b, c, d;
  int T;
  cin >> T;
  while (T--) {
    cin >> a >> b >> c >> d;
    if (b > min(a, d)) {
      cout << "No\n";
      continue;
    }
    if (c + 1 >= b) {
      cout << "Yes\n";
      continue;
    }
    a = (a - c) % b + c;
    if (a != c) a -= b;
    a = a - c;
    if (a < 0) a += b;
    if (solve(a, b, c, d % b))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
