#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int t;
int main(void) {
  scanf("%d", &t);
  for (int i = 0; i < t; ++i) {
    ll a, b, c, d;
    set<ll> done;
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    int k = 2;
    while (k < 10000) {
      if (a % k == 0 && b % k == 0 && c % k == 0 && d % k == 0) {
        a = a / i;
        b = b / i;
        c = c / i;
        d = d / i;
        k = 1;
      }
      k += 1;
    }
    ll cur = a;
    while (true) {
      if (done.find(cur) != done.end()) {
        printf("Yes\n");
        break;
      }
      ll under;
      ll po = (cur % b);
      if (cur == c && d < b) {
        printf("No\n");
        break;
      }
      if (po > c || cur < b) {
        printf("No\n");
        break;
      } else {
        ll diff = c - po;
        ll under = po + (diff / b) * b;
        if (under + d < b) {
          printf("No\n");
          break;
        } else {
          done.insert(cur);
          cur = under + d;
        }
      }
    }
  }
  return 0;
}
