#include <bits/stdc++.h>
using namespace std;
int t;
long long a, b, c, d, e, f;
signed main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    if (b > a || b > d || c < a % b)
      printf("No\n");
    else if (c >= b || b == d)
      printf("Yes\n");
    else {
      e = c - (a % b);
      f = e - (e % (d - b));
      if (b > f + (a % b) + (d - b))
        printf("No\n");
      else
        printf("Yes\n");
    }
  }
}
