#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
void solve() {
  cin >> a >> b >> c >> d;
  if (d < b || a < b) {
    puts("No");
    return;
  }
  long long diff = max(0ll, a - c);
  long long cur = a - (diff / b) * b;
  if (cur > c) {
    if (cur - b < 0) {
      puts("No");
      return;
    }
    cur -= b;
  }
  if (c >= b || d == b) {
    puts("Yes");
    return;
  }
  long long from = c + 1, to = b - 1;
  if (from > to) {
    puts("Yes");
    return;
  }
  long long add = d - b;
  long long go = max(0ll, from - cur);
  cur += add * ((go + add - 1) / add);
  if (cur >= from && cur <= to) {
    puts("No");
  } else {
    puts("Yes");
  }
}
int main() {
  int tn;
  scanf("%d\n", &tn);
  while (tn--) {
    solve();
  }
  return 0;
}
