#include <bits/stdc++.h>
using namespace std;
const double PI = 2 * acos(0.0), eps = 1e-8;
const long long oo = 1000000000000000000;
template <class T>
void show(const vector<T> &a) {
  cout << ((long long)(a.size())) << endl;
  for (T first : a) cout << first << " ";
  cout << endl;
}
const long long M = 998244353;
long long MOD(long long a) {
  if (a >= 0) return a >= M ? a % M : a;
  if (a <= -M) a %= M;
  return a ? a + M : a;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b - 1) {
      cout << "Yes" << endl;
      continue;
    }
    long long lf = c + 1, rg = b - 1;
    long long poor = 0;
    map<long long, long long> mp;
    long long fl = false;
    while (true) {
      poor++;
      if (poor == 100000) break;
      long long l = -1, r = a / b + 1;
      while (l + 1 < r) {
        long long m = (l + r) / 2;
        if (a - m * b > c)
          l = m;
        else
          r = m;
      }
      long long u = a - l * b;
      if (lf <= u && u <= rg) {
        fl = true;
        break;
      }
      if (mp[u] != 0) break;
      mp[u] = 1;
      a = u;
      a += d;
    }
    if (!fl || poor == 100000)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
