#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  long long a, b, c, d;
  while (t--) {
    cin >> a >> b >> c >> d;
    int ops = 0;
    while (a > 0 && ops < 1000000) {
      a -= b;
      if (a < 0) break;
      if (a <= c) a += d;
      ++ops;
    }
    if (ops >= 100000)
      cout << "Yes\n";
    else {
      cout << "No\n";
    }
  }
}
