#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using P = pair<int, int>;
const int INF = (int)1e9;
const LL INFL = (LL)1e18;
const int MOD = 1e9 + 7;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  for (int i = (int)(0); i < (int)(t); ++i) {
    LL a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    if (a % b > c || a < b) {
      cout << "No" << endl;
      continue;
    }
    LL x = a % b, y = d - b;
    LL ok = INFL, ng = -1;
    while (abs(ok - ng) > 1) {
      LL mid = (ok + ng) / 2;
      if (x + mid * y >= b)
        ok = mid;
      else
        ng = mid;
    }
    cout << (x + (ok - 1) * y <= c ? "Yes" : "No") << endl;
  }
}
