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