#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const int MX = 123456;
const int mod = (int)1e9 + 7;
const int base = 1023456789;
const unsigned long long BS1 = 10000019ULL;
const int INF = (1 << 29);
template <class T>
inline void fastScan(T &x) {
  register char c = getchar();
  int neg = 0;
  x = 0;
  for (; (c < 48 || c > 57) && (c != '-'); c = getchar())
    ;
  if (c == '-') {
    neg = 1;
    c = getchar();
  }
  for (; c > 47 && c < 58; c = getchar()) {
    x = (x << 1) + (x << 3) + c - 48;
  }
  if (neg) x = -x;
}
long long a, b, c, d, add, need;
void lowerRem() {
  add = d - b;
  if (add < 0 || a < 0) {
    puts("No");
    return;
  }
  if (add == 0) {
    puts("Yes");
    return;
  }
  need = (c - a) / add + 1;
  a = a + need * add;
  if (a < b) {
    puts("No");
    return;
  }
  puts("Yes");
  return;
}
void upperRem() {
  need = (a - c) / b + ((a - c) % b != 0);
  a -= b * need;
  lowerRem();
  return;
}
int main() {
  int test;
  fastScan(test);
  while (test--) {
    fastScan(a);
    fastScan(b);
    fastScan(c);
    fastScan(d);
    if (a < b)
      puts("No");
    else {
      a -= b;
      add = d - b;
      if (a <= c) {
        lowerRem();
      } else {
        upperRem();
      }
    }
  }
  return 0;
}
