#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;
ll A, B, C, D;
int cnt;
bool solve() {
  if (D < B) return true;
  if (A < B) return true;
  if (C + 1 >= B) return false;
  if (C < A % B) return true;
  ll diff = C - A % B;
  ll d = D % B;
  set<ll> visited;
  ll tmp = A % B;
  while (cnt < 100000 && C >= tmp && visited.count(tmp) == 0) {
    visited.insert(tmp);
    tmp = (tmp + D) % B;
    cnt++;
  }
  return cnt < 100000 && C < tmp;
}
int main() {
  int T;
  cin >> T;
  for (int t = 0; t < T; t++) {
    cin >> A >> B >> C >> D;
    cnt = 0;
    if (solve())
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
