#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    long long a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b)
      printf("No\n");
    else if (b > d)
      printf("No\n");
    else {
      if (c + 1 >= b) {
        printf("Yes\n");
      } else {
        long long diff = d - b;
        a %= b;
        long long lo = c + 1, hi = b - 1;
        if (lo <= a && a <= hi) {
          printf("No\n");
        } else {
          if (diff == 0) {
            if (a > c)
              printf("No\n");
            else
              printf("Yes\n");
          } else {
            long long k = (lo - a) / diff;
            a += k * diff;
            bool ok = 1;
            while (a <= hi) {
              if (lo <= a && a <= hi) {
                printf("No\n");
                ok = 0;
                break;
              }
              a += diff;
            }
            if (ok) {
              printf("Yes\n");
            }
          }
        }
      }
    }
  }
}
