#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return (x % y) ? gcd(y, x % y) : y; }
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
using Graph = vector<vector<long long>>;
long long inf = 300000000000000000;
const double PI = 3.14159265358979323846;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < (int)(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;
    }
    if (c >= b - 1) {
      cout << "Yes" << endl;
      continue;
    }
    a = a % b;
    d = d % b;
    if (d == 0) {
      if (a <= c)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
      continue;
    }
    long long k = gcd(b, d);
    if (b - 1 - (b - 1 - a) % d <= c) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  }
}
