#include <bits/stdc++.h>
const int inf = 0x3f3f3f3f;
const int mod = (int)1e9 + 9;
const int maxn = (int)1e4 + 5;
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    long long a, b, c, d;
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    if (d < b || a < b) {
      puts("No");
      continue;
    }
    if (b <= c) {
      puts("Yes");
      continue;
    }
    long long t;
    if (a - c >= b)
      t = (a - c) % b;
    else
      t = a - c;
    if (t == 0) c += d;
    if (c + t < b) {
      puts("No");
      continue;
    }
    long long t2 = c + t - b;
    if (b == d && t2 < c) {
      puts("Yes");
      continue;
    }
    if (t2 > c && t2 < b) {
      puts("No");
      continue;
    }
    while (t2 <= c) t2 += (d - b);
    if (t2 < b) {
      puts("No");
      continue;
    } else {
      puts("Yes");
      continue;
    }
  }
  return 0;
}
