#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long a, b, c, d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    bool flag = true;
    if (b > d) flag = false;
    long long x = a;
    long long y, z;
    for (int i = 1; i <= 300000; i++) {
      if (x <= c)
        y = x - b;
      else {
        z = (x - c) / b;
        if ((x - c) % b) z++;
        y = x - z * b;
      }
      if (y < 0) {
        flag = false;
        break;
      }
      if (b == d) break;
      z = (c - y) / (d - b) + 1;
      x = y + z * (d - b);
    }
    if (flag)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
