#include <bits/stdc++.h>
using namespace std;
template <typename T>
std::string printVector(const std::vector<T> &data) {
  std::stringstream ss;
  std::ostream_iterator<T> out_it(ss, ", ");
  ss << "[";
  std::copy(data.begin(), data.end() - 1, out_it);
  ss << data.back() << "]";
  return ss.str();
}
const int MOD = 1e9 + 7;
const long long LINF = 1001002003004005006ll;
const int INF = 1001001001;
long long int gcd(long long int a, long long int b) {
  if (a < b) swap(a, b);
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
signed main(int argc, char const *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int T;
  cin >> T;
  for (int i = (0); i < (T); ++i) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (B > D) {
      cout << "No" << endl;
      continue;
    }
    long long dif = gcd(D, B);
    long long L = (B - 1 - C);
    if (L <= 0) {
      cout << "Yes" << endl;
      continue;
    }
    if (L > dif) {
      cout << "No" << endl;
      continue;
    } else {
      long long c = (C + 1 - A) % dif;
      long long d = (D - 1 - A) % dif;
      if (c == 0) {
        cout << "No" << endl;
        continue;
      } else {
        if (c <= d) {
          cout << "Yes" << endl;
          continue;
        } else {
          cout << "No" << endl;
        }
      }
    }
  }
}
