#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
long long divup(long long x, long long y) {
  if (x % y == 0)
    return x / y;
  else
    return x / y + 1;
}
void solve(long long a, long long b, long long c, long long d) {
  if (a < b or b > d) {
    cout << "No" << endl;
    return;
  }
  a %= b;
  d %= b;
  d = min(d, b - d);
  if (d == 0) {
    if (a <= c)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return;
  }
  if (a > c) {
    cout << "No" << endl;
    return;
  }
  if (b - c < 1) {
    cout << "Yes" << endl;
    return;
  }
  long long z = a + d * divup(c - a + 1, d);
  if (z < b) {
    cout << "No" << endl;
    return;
  }
  long long hoge = abs(a - z) % d;
  if (hoge == 0) {
    cout << "Yes" << endl;
    return;
  }
  c++;
  b--;
  if (b - c >= hoge) {
    cout << "No" << endl;
    return;
  }
  c %= hoge;
  b %= hoge;
  z %= hoge;
  if (c < b) swap(b, c);
  if (z >= b and z <= c)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return;
}
signed main() {
  long long t;
  cin >> t;
  for (long long i = (0); i < (t); ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    solve(a, b, c, d);
  }
}
