#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
template <typename T>
using v = vector<T>;
const long long inf = 4611686018427387903;
void read() {}
template <typename Arg, typename... Args>
void read(Arg& arg, Args&... args) {
  cin >> (arg);
  read(args...);
}
void print() {}
template <typename Arg, typename... Args>
void print(Arg arg, Args... args) {
  cout << (arg) << " ";
  print(args...);
}
void debug() { cout << endl; }
template <typename Arg, typename... Args>
void debug(Arg arg, Args... args) {
  cout << (arg) << " ";
  debug(args...);
}
long long getInt() {
  long long a;
  cin >> a;
  return a;
}
const long long M = 1e6 + 1;
string solveStupid(long long a, long long b, long long c, long long d) {
  long long tot = 0;
  bool day = 1;
  if (a < b || b > d) return "No";
  while (a >= 0 && tot <= M) {
    if (day) {
      long long toRemove = a - c;
      long long daysNeeded = toRemove / b + !!(toRemove % b);
      a -= daysNeeded * b;
      day = 0;
    } else {
      a += d;
      day = 1;
      tot++;
    }
  }
  if (a >= 0)
    return "Yes";
  else
    return "No";
}
void run() {
  long long t;
  cin >> t;
  for (; t; t--) {
    long long a, b, c, d;
    read(a, b, c, d);
    cout << solveStupid(a, b, c, d);
    cout << '\n';
  }
}
int32_t main() {
  srand(time(0));
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(15);
  run();
  return 0;
}
