#include <bits/stdc++.h>
using namespace std;
int t;
long long a, b, c, d;
long long l, r;
bool check(long long l, long long r, long long d) {
  if (l % d == 0 || r % d == 0) return 1;
  return (l / d != r / d);
}
bool chk(long long a) {
  if (l <= r) {
    if (check(l, r, a))
      return 0;
    else
      return 1;
  } else {
    if (check(0, l, a) || check(r, d - 1, a))
      return 0;
    else
      return 1;
  }
}
long long gcd(long long x, long long y) {
  return (x % y == 0) ? y : gcd(y, x % y);
}
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (d < b) {
      puts("No");
      continue;
    }
    if (a < b) {
      puts("No");
      continue;
    }
    if (c + 1 > b - 1) {
      puts("Yes");
      continue;
    }
    long long k = (a - c) / b;
    a -= k * b;
    if (a > c) a -= b;
    if (a < 0) {
      puts("No");
      continue;
    }
    d %= b;
    if (d == 0) {
      puts("Yes");
      continue;
    }
    if (d < b - c) {
      puts("No");
      continue;
    }
    l = (c + 1) % d, r = (b - 1) % d;
    a = gcd(a, d);
    if (chk(a))
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
