#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  cin >> t;
  for (long long _ = (0); _ < (t); _++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool f = true;
    if (a > c) {
      a -= ((a - c) / b * b + ((a - c) % b == 0 ? 0 : b));
      if (a < 0) f = false;
    } else {
      a -= b;
      if (a < 0) f = false;
    }
    long long e = (d - b) % b;
    if (d - b < 0) f = false;
    if (b > c + 1 && e != 0)
      if (b % e != 0 || b - c + (c - a) % e > e) f = false;
    if (f)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
