#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
int t;
int main() {
  scanf("%d", &t);
  for (int i = 0; i < t; i++) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (d < b) {
      printf("No\n");
      continue;
    }
    long long belowc = a;
    if (a > c) {
      long long diff = a - c;
      diff /= b;
      belowc -= diff * b;
      if (belowc > c) belowc -= b;
      assert(belowc <= c);
    } else
      belowc -= b;
    if (belowc < 0) {
      printf("No\n");
      continue;
    }
    if (d == b) {
      printf("Yes\n");
      continue;
    }
    belowc += d;
    long long delta = d - b;
    delta -= (delta / b) * b;
    if (delta == 0) {
      printf("Yes\n");
      continue;
    }
    assert(delta >= 0);
    long long delta2 = delta - b;
    if (abs(delta2) > c) {
      printf("No\n");
      continue;
    }
    if (delta + c - b < 0) {
      printf("No\n");
      continue;
    }
    printf("Yes\n");
  }
}
