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