#include <bits/stdc++.h>
int main() {
  size_t N;
  std::cin >> N;
  for (size_t i = 0; i < N; i++) {
    long long init;
    long long buy;
    long long check;
    long long reload;
    std::cin >> init;
    std::cin >> buy;
    std::cin >> check;
    std::cin >> reload;
    if (init < buy) {
      std::cout << "No" << std::endl;
      continue;
    }
    if (reload < buy) {
      std::cout << "No" << std::endl;
      continue;
    }
    if (check < init % buy) {
      std::cout << "No" << std::endl;
      continue;
    }
    if (check - buy >= -1) {
      std::cout << "Yes" << std::endl;
      continue;
    }
    long long stock = init % buy;
    std::set<long long> record;
    while (true) {
      if (record.count(stock) > 0) {
        std::cout << "Yes" << std::endl;
        break;
      }
      record.insert(stock);
      if (check < stock) {
        if (stock < buy) {
          std::cout << "No" << std::endl;
          break;
        } else {
          stock %= buy;
        }
      } else {
        stock += reload;
        stock %= buy;
      }
    }
  }
  return 0;
}
