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