#include <bits/stdc++.h>
using namespace std;
long long A, B, C, D;
long long work() {
  long long temp = A;
  if (temp <= C)
    return temp;
  else {
    temp -= B * ((A - C) / B);
  }
  while (temp > C) {
    temp -= B;
  }
  return temp;
}
bool judge() {
  if (A < B) {
    return false;
  }
  if (A >= B && D < B) {
    return false;
  }
  if (A >= B && D > B) {
    long long temp = work();
    if (temp < 0) {
      return false;
    } else {
      temp += ((C - temp) / (D - B)) * (D - B);
      while (temp <= C) {
        temp += D - B;
      }
      if (temp < B) {
        return false;
      } else {
        return true;
      }
    }
  }
  if (A >= B && D == B) {
    long long temp = work();
    if (temp < 0) {
      return false;
    } else {
      return true;
    }
  }
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    cin >> A >> B >> C >> D;
    if (judge()) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
