#include <bits/stdc++.h>
using namespace std;
long long t, a, b, c, d, tmp;
void no(void) { cout << "No" << endl; }
void ya(void) { cout << "Yes" << endl; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    int n = 1e5, f = 0;
    while (n--) {
      tmp = (a - c) - 1;
      tmp = max(tmp, 0LL);
      a -= (b * (tmp / b));
      a -= b;
      if (a < 0) {
        no();
        f = 1;
        break;
      }
      a += d;
    }
    if (f == 0) ya();
  }
  return 0;
}
