#include <bits/stdc++.h>
using namespace std;
bool ss() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a < b) return false;
  if (d < b) return false;
  if (a > c) {
    long long t = (a - c) / b;
    if ((a - c) % b != 0) t++;
    a -= t * b;
    if (a < 0) return false;
  }
  if (d > c) {
    long long t1 = (d - c) / b;
    if ((d - c) % b != 0) t1++;
    d -= t1 * b;
    if (d == 0) return true;
    if (d < 0) return false;
  }
  long long t2 = (c + 1 - a) / d;
  if ((c + 1 - a) % d != 0) t2++;
  a += t2 * d;
  return !(a > c && a < b);
}
int main() {
  int T;
  cin >> T;
  int ca = 0;
  while (T--) {
    if (ss()) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
