#include <bits/stdc++.h>
using namespace std;
constexpr long long int INF = std::numeric_limits<long long int>::max();
bool solve() {
  long long int A, B, C, D;
  cin >> A >> B >> C >> D;
  if (B > A) {
    return false;
  }
  if (B > D) {
    return false;
  }
  if (C >= B) {
    return true;
  }
  set<long long int> history;
  history.insert(A % B);
  while (true) {
    A += D;
    if (A % B > C) {
      return false;
    }
    if (history.count(A % B)) {
      return true;
    }
    history.insert(A % B);
  }
}
signed main() {
  long long int n;
  cin >> n;
  while (n--) {
    if (solve()) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
