#include <bits/stdc++.h>
using namespace std;
int T;
long long A, B, C, D;
inline int read() {
  int X = 0, w = 0;
  char ch = 0;
  while (ch < '0' || ch > '9') {
    w |= ch == '-';
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &A, &B, &C, &D);
    bool check = true;
    long long p;
    int k = 0;
    while (1) {
      if (k > 100000) break;
      if (A < B) {
        check = false;
        break;
      }
      p = A / B;
      A -= B * p;
      if (A <= C) A += D;
      k++;
    }
    if (check == false)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
