#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll solve(ll a, ll b, ll c, ll d) {
  if (a < b) return -1;
  ll cur = a - b;
  if (cur > c) {
    cur -= (cur - c) / b * b;
    if (cur == c) {
      return cur + d;
    }
    if (cur < b) return -1;
    cur -= b;
    cur += d;
  } else {
    cur += d;
  }
  return cur;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll x = solve(a, b, c, d);
    if (x == -1) {
      cout << "No" << endl;
      continue;
    }
    bool flag = true;
    for (int j = 0; j < 1000000; j++) {
      x = solve(x, b, c, d);
      if (x == -1) {
        flag = false;
        break;
      }
    }
    cout << (flag ? "Yes" : "No") << endl;
  }
  return 0;
}
