#include <bits/stdc++.h>
int main() {
  int t = 0;
  long long ans = 0, kotae_a;
  long long a = 0, b = 0, c = 0, d = 0;
  std::cin >> t;
  for (int i = 0; i < t; i++) {
    std::cin >> a >> b >> c >> d;
    ans = a - b;
    while (ans > 0) {
      if (ans <= c) {
        ans += d;
      }
      ans = ans - b;
    }
    if (ans == 0) {
      std::cout << "Yes" << std::endl;
    } else {
      std::cout << "No" << std::endl;
    }
    ans = 0;
  }
  return 0;
}
