#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n = 0;
  std::cin >> n;
  long a = 0;
  long b = 0;
  long c = 0;
  long d = 0;
  long x = 0;
  for (int i = 0; i < n; i++) {
    std::cin >> a;
    std::cin >> b;
    std::cin >> c;
    std::cin >> d;
    if (a - b < 0) {
      std::cout << "No" << std::endl;
      continue;
    }
    if (d - b < 0) {
      std::cout << "No" << std::endl;
      continue;
    }
    x = (a - c) % b;
    if (x > 0 && b > x + c) {
      std::cout << "No" << std::endl;
      continue;
    }
    if (d - b == 0) {
      if (a - b < c) {
        std::cout << "Yes" << std::endl;
      } else {
        std::cout << "No" << std::endl;
      }
    } else if (b > c + (d - b)) {
      std::cout << "No" << std::endl;
    } else if (b == c + (d - b)) {
      if ((c - (b - a)) % (d - b) == 0) {
        std::cout << "Yes" << std::endl;
      } else {
        std::cout << "No" << std::endl;
      }
    } else {
      std::cout << "Yes" << std::endl;
    }
  }
}
