#include <bits/stdc++.h>
using namespace std;
const int vx[4] = {0, 1, 0, -1};
const int vy[4] = {1, 0, -1, 0};
long long t;
void f() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  map<long long, bool> mp;
  while (1) {
    if (a / b) {
      a %= b;
      a += b;
    }
    if (mp[a]) break;
    mp[a] = true;
    a -= b;
    if (a < 0) {
      cout << "No" << endl;
      return;
    }
    if (a <= c) a += d;
  }
  cout << "Yes" << endl;
}
signed main() {
  cin >> t;
  for (long long i = (long long)0; i < (long long)t; i++) {
    f();
  }
}
