#include <bits/stdc++.h>
using namespace std;
const long long LLINF = (1LL << 60);
const long long INF = (1LL << 30);
const double DINF = std::numeric_limits<double>::infinity();
const long long MOD = 1000000007;
long long A, B, C, D;
enum Result { Ok = 0, Big = 1, Small = 2 };
static inline long long check(long long val) {
  if (val < A) {
    return Small;
  }
  if (val - B <= C) {
    return Small;
  }
  if (val - B >= B) {
    return Big;
  }
  return Ok;
}
bool boundary() {
  long long lb = 1, ub = 1000000000000000000ll;
  long long i = 0;
  while (lb < ub && i < 100000) {
    long long mid = (lb + ub) / 2;
    double tmp = static_cast<double>(B) * static_cast<double>(mid);
    if (tmp > 1E18) {
      ub = mid;
    }
    long long judged = A - B * mid;
    if (judged <= C) {
      ub = mid;
    } else if (judged >= B) {
      lb = mid + 1;
    } else {
      return false;
    }
    i++;
  }
  assert(i < 100000);
  return true;
}
long long get_border(long long val) {
  long long lb = 0, ub = 1000000000000000000ll;
  long long i = 0;
  while (lb < ub && i < 100000) {
    long long mid = (lb + ub) / 2;
    double tmp = static_cast<double>(B) * static_cast<double>(mid);
    if (tmp > 1E18) {
      ub = mid;
    }
    long long judged = val - B * mid;
    if (judged <= C) {
      ub = mid;
    } else if (judged > C) {
      lb = mid + 1;
    }
    i++;
  }
  assert(i < 100000);
  for (long long i = 3; i > -3; --i) {
    long long tmp = ub + i;
    if (tmp < 0) {
      continue;
    }
    if (val - B * tmp > C) {
      return val - B * tmp;
    }
  }
  return val;
}
long long get_init() { return get_border(A); }
long long get_sub() {
  long long init = get_init();
  long long next = get_border(init - B + D);
  return next - init;
}
void solve() {
  cin >> A >> B >> C >> D;
  if (D < B || A < B) {
    printf("No\n");
    return;
  } else if (D == B) {
    if (boundary()) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
    return;
  }
  long long init = get_init();
  if (init < B) {
    printf("No\n");
    return;
  }
  long long sub = get_sub();
  if (sub == 0) {
    if (boundary()) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
    return;
  }
  if (sub < 0) {
    init = init + sub;
    sub = abs(sub);
  }
  long long lb = init, ub = 1000000000000000000ll;
  long long i = 0;
  while (lb < ub && i < 100000) {
    long long mid = (lb + ub) / 2;
    long long judged = ((mid - init) / sub) * sub + init;
    long long res = check(judged);
    if (res == Ok) {
      printf("No\n");
      return;
    } else if (res == Big) {
      ub = mid;
    } else {
      lb = mid + 1;
    }
    i++;
  }
  assert(i < 100000);
  printf("Yes\n");
}
signed main() {
  long long T;
  cin >> T;
  for (long long i = 0; i < T; ++i) {
    solve();
  }
  return 0;
}
