#include <bits/stdc++.h>
using namespace std;
int t;
long long a, b, c, d;
long long l, r;
bool chk(long long a) {
  if (l <= r) {
    if (l <= a && a <= r)
      return 0;
    else
      return 1;
  } else {
    if (l < a && a < r)
      return 0;
    else
      return 1;
  }
}
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;
    }
    l = (c + 1) % d, r = (b - 1) % d;
    a %= d;
    bool f = 1;
    for (int i = 1; i <= 10000; i++) {
      if (!chk(a)) {
        f = 0;
        puts("No");
        break;
      }
      a += ((c - a) / d) * d;
      if (a < c) a += d;
    }
    if (f) puts("Yes");
  }
  return 0;
}
