#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, x, y, t, T;
long long a, b, c, d;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b || b > d) {
      printf("No\n");
      continue;
    }
    if (b < c) {
      printf("Yes\n");
      continue;
    }
    long long p1 = a % b, p2 = d % b;
    if (p2 == 0) {
      if (p1 > c && p1 < b)
        printf("No\n");
      else
        printf("Yes\n");
      continue;
    }
    long long mx = (c - p1) / p2;
    mx = p1 + mx * p2;
    if (mx + p2 < b) mx += p2;
    if (mx < c) mx += p2;
    if (mx > c && mx < b)
      printf("No\n");
    else
      printf("Yes\n");
  }
}
