#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;
void solve(long long a, long long b, long long c, long long d) {
  if (a < b) {
    cout << "No" << endl;
    return;
  }
  a %= b;
  if (a > c) {
    cout << "No" << endl;
    return;
  }
  map<long long, bool> used;
  while (true) {
    if (a <= c) a += d;
    if (a < b) {
      cout << "No" << endl;
      return;
    }
    a %= b;
    if (used[a]) {
      cout << "Yes" << endl;
      return;
    }
    used[a] = 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;
    solve(a, b, c, d);
  }
}
