#include <bits/stdc++.h>
using namespace std;
unsigned long long read() {
  unsigned long long f = 1, x = 0;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * f;
}
int n, m;
int main() {
  int t;
  t = read();
  while (t--) {
    unsigned long long a, b, c, d;
    a = read(), b = read(), c = read(), d = read();
    if (a < b) {
      printf("No\n");
      continue;
    }
    a = (a - (a - c) / b * b);
    if (a <= c) a += d;
    if (a < b) {
      printf("No\n");
      continue;
    }
    if (d < b) {
      printf("No\n");
      continue;
    }
    int f = 0;
    for (int i = 1; i <= 190817; i++) {
      if (a <= c) a += d;
      if (a < b) {
        printf("No\n");
        f = 1;
        break;
      } else
        a -= b;
    }
    if (!f) printf("Yes\n");
  }
}
