#include <bits/stdc++.h>
using namespace std;
long long p = 1000000007;
vector<long long> rui(19, 1);
vector<long long> par;
long long root(long long ser) {
  if (par[ser] == -1) {
    return ser;
  }
  long long ans = root(par[ser]);
  par[ser] = ans;
  return ans;
}
bool marge(pair<long long, long long> a) {
  long long x = root(a.first);
  long long y = root(a.second);
  if (x != y) {
    par[x] = y;
  }
  return x != y;
}
long long gcd(long long a, long long b) {
  if (a < b) {
    swap(a, b);
  }
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
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;
    if (d >= b || a >= b) {
      if (c >= b) {
        cout << "Yes" << endl;
      } else {
        long long x = a % b;
        long long gc = gcd(b, d);
        long long pl = (b - 1 - x) / gc;
        x += pl * gc;
        if (x > c) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      }
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
