#include <bits/stdc++.h>
using namespace std;
template <class T>
void say(bool val, T yes = "Yes", T no = "No") {
  cout << (val ? yes : no) << endl;
}
template <class T>
void chmin(T &a, T b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
T gcd(T n, T m) {
  return n ? gcd(m % n, n) : m;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  for (int num = 0; num < t; num++) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
    } else if (d < b) {
      cout << "No" << endl;
    } else if (b == c + 1) {
      cout << "Yes" << endl;
    } else {
      if (c >= b) {
        cout << "Yes" << endl;
      } else {
        if (a % b > c) {
          cout << "No" << endl;
        } else if (d % b == 0LL) {
          cout << "Yes" << endl;
        } else {
          long long int l = c - (a % b);
          long long int r = b - (a % b) - 1LL;
          if (gcd(b, d % b) == 1LL) {
            cout << "No" << endl;
          } else if (r / (d % b) - l / (d % b) == 0) {
            cout << "Yes" << endl;
          } else {
            cout << "No" << endl;
          }
        }
      }
    }
  }
  return 0;
}
