#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long MOD = 1000000007;
const long long INF = 1e16;
const long double EPS = 1e-10;
const long double PI = 3.141592653589793;
const string abc = "abcdefghijklmnopqrstuvwxyz";
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const pair<long long, long long> fd[] = {make_pair(1, 0), make_pair(-1, 0),
                                         make_pair(0, 1), make_pair(0, -1)};
queue<string> que;
bool solve(long long a, long long b, long long c, long long d) {
  if (a < b || d < b) return false;
  if (c >= b) return true;
  long long k = c - (a % b), j = b - (a % b), m = d % b;
  if (m == 0 && k < 0) return false;
  if (m != 0 && (j - k - 1 >= m || (k + m) % m >= (j + m) % m &&
                                       (k + m) % m != 0 && (j + m) % m != 0))
    return false;
  return true;
}
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;
    que.push((solve(a, b, c, d) ? "Yes" : "No"));
  }
  while (!que.empty()) {
    cout << que.front() << endl;
    que.pop();
  }
}
