#include <bits/stdc++.h>
using namespace std;
void yes() { cout << "Yes" << endl; }
void no() { cout << "No" << endl; }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int test;
  cin >> test;
  long long a, b, c, d;
  while (test--) {
    cin >> a >> b >> c >> d;
    int cnt = 1000000;
    bool ok = true;
    while (cnt--) {
      if (a < b) ok = false;
      a -= b;
      if (a <= c) a += d;
    }
    if (ok) {
      yes();
    } else {
      no();
    }
  }
}
