#include <bits/stdc++.h>
using namespace std;
set<long long> s;
int main() {
  long long t, A, B, C, D, flag = 1;
  cin >> t;
  while (t--) {
    s.clear();
    flag = 1;
    cin >> A >> B >> C >> D;
    s.insert(A);
    long long x = A;
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    while (1) {
      long long left;
      if (x == C) {
        left = 0;
      } else if ((x - C) % B == 0) {
        left = C;
      } else {
        left = x - ((x - C) / B + 1) * B;
      }
      if (x < C) left = x - B;
      if (left < 0) {
        flag = 0;
        break;
      }
      x = D + left;
      if (!s.count(x)) {
        s.insert(x);
      } else {
        flag = 1;
        break;
      }
    }
    if (flag) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
