#include <bits/stdc++.h>
using namespace std;
using vint = std::vector<int>;
using ll = long long;
using vll = std::vector<ll>;
template <class T>
void chmin(T& a, const T& b) {
  a = std::min(a, b);
}
template <class T>
void chmax(T& a, const T& b) {
  a = std::max(a, b);
}
int prime[25] = {2,  3,  5,  7,  11, 13, 17, 19, 23, 29, 31, 37, 41,
                 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
string S;
int B;
int decomposition_of_numbers[101];
int prime_filling_up[101];
int main() {
  random_device rnd;
  int T;
  cin >> T;
  unsigned long long int A, B, C, D;
  ofstream outputfile("sunuke3.txt");
  bool check = false;
  for (int init = (0); init < (T); ++init) {
    check = false;
    cin >> A >> B >> C >> D;
    for (int i = (1); i < (100000); ++i) {
      if (A < B) {
        check = true;
        break;
      }
      A -= B;
      if (A <= C) A += D;
      if (A > 100000 || B > 100000 || C > 100000 || D > 100000) {
        int c = rnd() % 2;
        cout << c << endl;
        if (c)
          check = true;
        else
          check = false;
      }
    }
    if (check)
      outputfile << "No" << endl;
    else
      outputfile << "Yes" << endl;
  }
}
