#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
int a[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long cur = a;
    bool f = true;
    for (int j = 0; j < 20000; j++) {
      if (cur < b) {
        f = false;
        break;
      }
      cur -= b;
      if (cur <= c) cur += d;
    }
    if (f)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
