#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;
constexpr long long INF = std::numeric_limits<LL>::max();
const double PI = acos(-1);
struct Tll {
  LL first, second, third;
};
LL h, w, n, m, k, t, s, q, last, cnt, sum[2000000], ans, dp[5000][5000],
    a[2000000], b[2000000];
string str;
bool f;
char c;
int di[4][2] = {{0, 1}, {1, 0}, {-1, 0}, {0, -1}};
struct Edge {
  LL from, cost;
};
vector<Edge> vec[1000000];
vector<pair<LL, LL> > v;
map<string, LL> ma;
set<LL> st;
void YN(bool f) {
  if (f)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
void yn(bool f) {
  if (f)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
LL gcd(LL x, LL y) {
  LL r;
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
int main() {
  cin >> n;
  for (LL i = 0; i < n; i++) {
    LL x, y, z, w;
    cin >> x >> y >> z >> w;
    if (x < y)
      cout << "No" << endl;
    else {
      LL A[5];
      if (y > w)
        cout << "No" << endl;
      else {
        if (y - 1 <= z)
          cout << "Yes" << endl;
        else {
          x %= y;
          if (x > z)
            cout << "No" << endl;
          else {
            if (y == w) {
              if (x <= z)
                cout << "Yes" << endl;
              else
                cout << "No" << endl;
            } else {
              A[4] = w - y;
              if (y / A[4] * A[4] - x / A[4] * A[4] + x > z &&
                  y / A[4] * A[4] - x / A[4] * A[4] + x < y)
                cout << "No" << endl;
              else if (y / A[4] * (A[4]) - x / A[4] * A[4] - A[4] + x > z)
                cout << "No" << endl;
              else
                cout << "Yes" << endl;
            }
          }
        }
      }
    }
  }
  return 0;
}
