#include <bits/stdc++.h>
using namespace std;
int num = 0;
long long int aa(long long int x, long long int y, long long int z,
                 long long int k) {
  num++;
  if (num > 100) return -2;
  k = k + z;
  k = k % x;
  if (k > y) return -1;
  k += (y - k) / x;
  return k;
}
int main() {
  int n;
  long long int a, b, c, d;
  scanf("%d", &n);
  while (n--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    long long int x = a - b;
    if (x < 0 || (d - b) < 0) {
      printf("No\n");
      continue;
    } else if (x > c) {
      while (x > c && x >= b) {
        x = x % b;
      }
      if (x > c) {
        printf("No\n");
        continue;
      } else
        x += (c - x) / b;
    }
    do {
      x = aa(b, c, d, x);
    } while (x != -1 && x != -2);
    if (x == -1) {
      printf("No\n");
      continue;
    } else {
      printf("Yes\n");
      continue;
    }
  }
  return 0;
}
