#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d;
  int t;
  cin >> t;
  set<long long> s;
  while (t--) {
    s.clear();
    cin >> a >> b >> c >> d;
    int flag = 0;
    int counter = 0;
    while (1) {
      ++counter;
      if (b > a) {
        flag = 0;
        break;
      }
      a -= b;
      s.insert(a);
      if (counter != s.size()) {
        flag = 1;
        break;
      }
      if (a <= c) a += d;
    }
    if (flag)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
