#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template <typename T>
using VT = vector<T>;
template <typename T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;
int main(void) {
  int T;
  cin >> T;
  for (int(i) = 0; (i) < (T); (i)++) {
    LL A, B, C, D;
    cin >> A >> B >> C >> D;
    bool valid = true;
    unordered_set<LL> memo_zaiko;
    while (!memo_zaiko.count(A) && valid) {
      memo_zaiko.emplace(A);
      LL foo = max(A - C, 0LL);
      A = A - B * ((foo / B) + 1);
      if (A < 0) {
        if (((foo / B) + 1) == 1) {
          valid = false;
          break;
        } else {
          if (A + B > C) {
            valid = false;
            break;
          } else {
            A += B;
          }
        }
      }
      A += D;
    }
    cout << (valid ? "Yes" : "No") << endl;
  }
}
