#include <bits/stdc++.h>
using namespace std;
const int dr[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dc[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int inf = 0x3f3f3f3f;
const long long linf = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double EPS = 1e-7;
const long long mod = 1e9 + 7;
const long long mod2 = 1e9 + 9;
long long mypow(long long x, long long y, long long p) {
  long long ret = 1;
  while (y) {
    if (y & 1) ret = (ret * x) % p;
    x = (x * x) % p;
    y /= 2;
  }
  return ret;
}
long long inv(long long x, long long p) { return mypow(x, p - 2, p); }
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
const int MAX = 2e5 + 3;
long long T, A, B, C, D;
int main() {
  scanf("%lld", &T);
  while (T--) {
    scanf("%lld %lld %lld %lld", &A, &B, &C, &D);
    bool f = true;
    map<pair<long long, long long>, int> mp;
    if (B > A || B > D) {
      f = false;
    } else {
      for (;;) {
        if (A < B) {
          f = false;
          break;
        }
        pair<long long, long long> tt;
        A %= B;
        tt.first = A;
        if (A <= C) A += D;
        tt.second = A;
        if (mp[tt])
          break;
        else
          mp[tt] = 1;
      }
    }
    if (f)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
