#include <bits/stdc++.h>
using namespace std;
int T;
long long A, B, C, D;
int main() {
  scanf("%d", &T);
  for (long long t = 0; t < (T); ++t) {
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    if (A - B < 0) {
      printf("No\n");
      continue;
    }
    if (B <= C + 1) {
      printf("Yes\n");
      continue;
    }
    long long L = A - ((A - C) / B + !!((A - C) % B)) * B;
    if (L < 0) {
      printf("No\n");
      continue;
    }
    long long DB = D % B;
    if (!DB) {
      printf("Yes\n");
      continue;
    }
    if (DB < B - C) {
      printf("No\n");
      continue;
    }
    long long F = (C - L) / DB * DB + L;
    long long f = F;
    do {
      if ((f + DB) % B > C) {
        printf("No\n");
        f = -F;
        break;
      }
      f = ((B + C - f) / DB * DB + f) % B;
    } while (F != f);
    if (F == f) printf("Yes\n");
  }
  return 0;
}
