#include <bits/stdc++.h>
using namespace std;
void Q(int q) {
  if (q) {
    puts("No");
  } else {
    puts("Yes");
  }
}
void solve() {
  long long a, b, c, d;
  map<long long, int> mp;
  scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
  while (1) {
    if (a < b) {
      Q(1);
      return;
    }
    if (mp.count(a)) {
      Q(0);
      return;
    }
    mp[a] = 1;
    long long asd = a;
    long long temp = a % b;
    a = c / b * b + temp;
    if (a > c || asd == a) {
      a -= b;
      if (a < 0) {
        Q(1);
        return;
      }
    }
    a += d;
  }
}
int main() {
  int test;
  scanf("%d", &test);
  while (test--) {
    solve();
  }
}
