#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, A, B, C, D, rest;
  long counter = 0;
  vector<string> v;
  cin >> T;
  for (int i = 0; i < T; ++i) {
    cin >> A >> B >> C >> D;
    rest = A;
    while (rest >= B && counter < 100000) {
      rest = rest - B;
      if (rest <= C) {
        rest = rest + D;
      }
      counter++;
    }
    if (counter > 100000) {
      v.push_back("Yes");
    } else {
      v.push_back("No");
    }
    counter = 0;
  }
  for (int i = 0; i < v.size(); ++i) {
    cout << v[i] << endl;
  }
}
