#include <bits/stdc++.h>
std::istream& operator>>(std::istream& input, __int128_t& value) {
  int64_t tmp;
  input >> tmp;
  value = tmp;
  return input;
}
std::ostream& operator<<(std::ostream& output, const __int128_t value) {
  output << (int64_t)value;
  return output;
}
__int128_t imax(const __int128_t a, const __int128_t b) {
  return std::max(a, b);
}
__int128_t imin(const __int128_t a, const __int128_t b) {
  return std::min(a, b);
}
std::vector<int> irange(const int begin, const int end) {
  std::vector<int> ret;
  for (int i = begin; i <= end; i++) {
    ret.push_back(i);
  }
  return ret;
}
template <typename T>
void printvec(const std::vector<T>& vec) {
  for (int i = 0; i < vec.size(); i++) {
    std::cout << vec[i] << " ";
  }
  std::cout << std::endl;
}
__int128_t gcd(__int128_t a, __int128_t b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
int T;
std::vector<__int128_t> a, b, c, d;
bool solve(__int128_t A, __int128_t B, __int128_t C, __int128_t D) {
  if (A < B) {
    return false;
  }
  if (D < B) {
    return false;
  }
  if (C >= B) {
    return true;
  }
  if (C < A % B) {
    return false;
  }
  if (D % B == 0) {
    return true;
  }
  __int128_t g = gcd(A % B, D % B);
  __int128_t n = (C - A % B) / g;
  __int128_t t = A % B + g * n;
  if (B <= t + g) {
    return true;
  } else {
    return false;
  }
}
int main(int argc, char** argv) {
  std::cin >> T;
  a.resize((T) + 1);
  b.resize((T) + 1);
  c.resize((T) + 1);
  d.resize((T) + 1);
  for (int i = (1); i <= (T); i++) {
    std::cin >> a[i] >> b[i] >> c[i] >> d[i];
  };
  for (int64_t i = ((int64_t)1); i <= ((int64_t)T); i++) {
    if (solve(a[i], b[i], c[i], d[i])) {
      std::cout << "Yes" << std::endl;
    } else {
      std::cout << "No" << std::endl;
    }
  }
  return 0;
}
