#include <bits/stdc++.h>
using std::pair;
using std::string;
using std::vector;
template <typename T>
bool chkmax(T& a, T b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
bool chkmin(T& a, T b) {
  return a > b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
string procStatus() {
  std::ifstream t("/proc/self/status");
  return string(std::istreambuf_iterator<char>(t),
                std::istreambuf_iterator<char>());
}
template <typename T>
T read(T& x) {
  int f = 1;
  x = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - 48;
  return x *= f;
}
int main() {
  int T;
  long long a, b, c, d;
  read(T);
  while (T--) {
    read(a), read(b), read(c), read(d);
    if (a < b || d < b) {
      puts("No");
    } else if (c >= b) {
      puts("Yes");
    } else if (a % b > c) {
      puts("No");
    } else {
      long long x = d % b, y = a % b;
      if (x == 0) {
        puts("Yes");
        continue;
      }
      long long t = (c - y + x) / x;
      if (y + t * x < b)
        puts("No");
      else
        puts("Yes");
    }
  }
  return 0;
}
