#include <bits/stdc++.h>
using namespace std;
long long A, B, C, D;
bool check(long long a, long long b, long long c, long long d) {
  int t = 10000;
  long long now = a - b;
  if (now < 0) return 0;
  while (t--) {
    if (now <= c) now += d;
    now = now - b;
    if (now < 0) return 0;
  }
  return 1;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    if (!check(A, B, C, D)) {
      printf("No\n");
    } else {
      long long a;
      if (A <= C)
        a = A - B;
      else
        a = min((A - C) % B + C, A - B);
      long long x = D % B;
      if (D < B) {
        printf("No\n");
        continue;
      }
      if (B <= C) {
        printf("Yes\n");
        continue;
      }
      if (x == 0) {
        if (B > a && C < a)
          printf("No\n");
        else
          printf("Yes\n");
        continue;
      }
      long long an1 = (C - a) / x - 10;
      an1 = max(an1, 0ll);
      long long an2 = (B - a) / x + 10;
      int fl = 0;
      if (an2 * x + a <= C) {
        printf("Yes\n");
        continue;
      }
      for (long long i = an1; i <= an2; i++) {
        if (a + i * x > C && a + i * x < B) {
          fl = 1;
          break;
        }
        if (a + i * x >= B) break;
      }
      if (fl == 1)
        printf("No\n");
      else
        printf("Yes\n");
    }
  }
}
