#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using ii = pair<int, int>;
using lu = unsigned long long;
using l = long long;
using vs = vector<string>;
using vii = vector<ii>;
using vl = vector<l>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using ll = pair<l, l>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vd = vector<double>;
using vvd = vector<vd>;
using mll = unordered_map<l, l>;
const l INF = numeric_limits<l>::max();
const double EPS = 1e-10;
static constexpr auto PI = 3.1415926;
const l e0 = 1, e3 = 1000, e5 = 100000, e6 = 10 * e5, e7 = 10 * e6,
        e8 = 10 * e7, e9 = 10 * e8;
const char lf = '\n';
const l MOD = e9 + 7;
bool possible(l a, l b, l c, l d) {
  if (d < b || a < b) return false;
  if (c >= b) return true;
  l x = c + 1, y = b - 1;
  if (y < x) return true;
  l p = a % b;
  l k = d % b;
  if (k == 0) return !(p >= x && p <= y);
  l j = (x - p + k - 1) / k;
  l q = p + k * j;
  return !(q >= x && q <= y);
}
void solve(istream& in, ostream& out) {
  l tcc;
  in >> tcc;
  for (l i = l(0); i < l(tcc); i++) {
    l a, b, c, d;
    in >> a >> b >> c >> d;
    out << (possible(a, b, c, d) ? "Yes" : "No") << lf;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(15);
  solve(cin, cout);
}
