#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pii = pair<int, int>;
template <typename T>
using Vec = vector<T>;
template <typename T>
bool in_range(T x, T lb, T ub) {
  return lb <= x && x < ub;
}
template <typename T>
bool in_range(T x, T y, T lb, T ub) {
  return in_range(x, lb, ub) && in_range(y, lb, ub);
}
template <typename T>
void modAdd(T& a, T b, T mod) {
  a = (a + b + mod) % mod;
}
template <typename T>
void modMul(T& a, T b, T mod) {
  a = (a * b) % mod;
}
template <typename T>
void minUpdate(T& a, T b) {
  a = min(a, b);
}
template <typename T>
void maxUpdate(T& a, T b) {
  a = max(a, b);
}
int bitCount(int x) { return __builtin_popcount(x); }
int bitCount(lint x) { return __builtin_popcountll(x); }
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1},
          Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
const double EPS = 1e-9;
const double PI = acos(-1);
lint A, B, C, D;
lint calc_Bk(lint x, lint y) {
  lint lb = 0, ub = 1L << 60;
  while (ub - lb > 1) {
    lint med = (ub + lb) / 2;
    if (x + med * y < B)
      lb = med;
    else
      ub = med;
  }
  return lb;
}
lint calc_Ck(lint x, lint y) {
  lint lb = 0, ub = 1L << 60;
  while (ub - lb > 1) {
    lint med = (ub + lb) / 2;
    if (x + med * y <= C)
      lb = med;
    else
      ub = med;
  }
  return ub;
}
bool judge() {
  int k = 0;
  unordered_set<lint> hist;
  while (A >= B && k < 100000) {
    hist.insert(A);
    A %= B;
    if (A <= C) {
      A += D;
      if (hist.count(A)) return true;
    }
  }
  if (k == 100000) return true;
  return false;
}
int main() {
  int T;
  cin >> T;
  for (int i = (0); i < (T); ++i) {
    cin >> A >> B >> C >> D;
    if (judge())
      puts("Yes");
    else
      puts("No");
  }
}
