#include <bits/stdc++.h>
using namespace std;
long long Ceil(double val) { return (long long)val + 1LL; }
int main() {
  int times;
  scanf("%d", &times);
  for (int tmn = 1; tmn <= times; tmn++) {
    long long A, B, C, D;
    scanf("%lld %lld %lld %lld", &A, &B, &C, &D);
    long long num = A;
    if (num < B) {
      printf("No\n");
      continue;
    }
    bool flag = false;
    for (int i = 1; i <= 50000; i++) {
      if (num < B) {
        flag = true;
        break;
      }
      num -= B;
      if (num < 0) {
        flag = true;
        break;
      }
      if (num > C) {
        if (num - (num - C) / B * B > C)
          num = num - ((num - C) / B + 1LL) * B;
        else
          num = num - (num - C) / B * B;
      }
      if (num < 0) {
        flag = true;
        break;
      }
      num = num + D;
    }
    if (flag == true)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
