#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const long long INF = 0x3f3f3f3f3f3f3f3f;
const long long llinf = (1LL << 61);
const int inf = (1 << 30);
const int nmax = 1e5 + 50;
const int mod = 1e9 + 7;
using namespace std;
int t, i;
long long a, b, c, d, f;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cerr.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    for (i = 1; i <= 300000; i++) {
      if (a < b) break;
      f = (a - c) / b + ((a - c) % b != 0);
      f = max(f, 1LL);
      a -= f * b;
      if (a < 0) break;
      a += d;
    }
    if (i == 300001)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
