#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  for (long long(i) = long long(0); (i) < long long(N); (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) {
      cout << ("Yes") << endl;
      continue;
    }
    a = a % b;
    d = d % b;
    if (d == 0) {
      cout << ("Yes") << endl;
      continue;
    }
    long long x1 = a + ((c - a) / d) * d;
    long long x2 = a + ((c - a) / d) * d - d;
    long long x3 = a + ((c - a) / d) * d + d;
    if ((b > x1) && (c < x1)) {
      cout << ("No") << endl;
    } else if ((b > x2) && (c < x2)) {
      cout << ("No") << endl;
    } else if ((b > x3) && (c < x3)) {
      cout << ("No") << endl;
    } else {
      cout << ("Yes") << endl;
    }
  }
  return 0;
}
