#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int main() {
  ios_base::sync_with_stdio(false);
  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;
    set<long long> night;
    bool flag = true;
    while (1) {
      long long len = night.size();
      night.insert(a);
      if (len == night.size()) {
        break;
      }
      long long num = (a - c) / b;
      if ((a - c) % b != 0) num += 1;
      if (num < 1) num = 1;
      a -= num * b;
      if (a < 0) {
        flag = false;
        goto end;
      }
      if (a <= c) {
        a += d;
      }
    }
  end:;
    if (flag)
      cout << "Yes" << '\n';
    else
      cout << "No" << '\n';
  }
  return 0;
}
