#include <bits/stdc++.h>
using namespace std;
int tn;
long long a, b, c, d;
int main() {
  scanf("%d", &tn);
  while (tn--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    bool r = true;
    for (int _ = 0, ThxDem = 10000; _ < ThxDem; ++_) {
      if (a < b) {
        r = false;
        break;
      }
      a -= b;
      if (a > c) a -= (a - c + b - 1) / b * b;
      assert(a <= c);
      if (a < 0) {
        r = false;
        break;
      }
      a += d;
    }
    puts(r ? "Yes" : "No");
  }
  return 0;
}
