#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const long long mod = 1e9 + 7;
const int inf = 1 << 30;
long long gcd(long long a, long long b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  vector<string> ans(t);
  for (int i = 0; i < (int)(t); i++) {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    bool f = 1;
    if (a < b || b < d) f = 0;
    if (gcd(b, d) == 1 && b - c != 1) f = 0;
    if ((c - (a - b)) / gcd(b, d) * gcd(b, d) + (a - b) + gcd(b, d) < b) f = 0;
    if (f)
      ans[i] = "Yes";
    else
      ans[i] = "No";
  }
  for (int i = 0; i < (int)(t); i++) {
    cout << ans[i] << endl;
  }
}
