#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 100;
signed main() {
  long long T;
  cin >> T;
  while (T--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    }
    if (c > b) {
      cout << "Yes" << endl;
      continue;
    }
    long long tmp = a / b;
    a -= tmp * b;
    if (a < b && c < a) {
      cout << "No" << endl;
      continue;
    }
    if (b == d) {
      cout << "Yes" << endl;
      continue;
    }
    long long t = d - b;
    long long l = 0, r = b / t + 10;
    while (r - l > 1) {
      long long mid = (l + r) / 2;
      if (mid * t + a > c)
        r = mid;
      else
        l = mid;
    }
    bool flag = false;
    for (long long j = 0; j < 100; j++) {
      for (long long i = max(0LL, l - 1000LL); i < l + 1000LL; i++) {
        if (c < i * t + a - b * j && i * t + a - b * j < b) flag = true;
      }
    }
    if (flag)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
