#include <bits/stdc++.h>
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
template <class T>
void view(T e) {
  cout << e << endl;
}
template <class T>
void view(const vector<T> &v) {
  for (const auto &e : v) {
    cout << e << " ";
  }
  cout << endl;
}
template <class T>
void view(const vector<vector<T>> &vv) {
  for (const auto &v : vv) {
    view(v);
  }
}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int, int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < (int)(t); i++) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    int ct = 1000000;
    while (ct--) {
      if (a / b - (a - c + b - 1) / b < 0 || a / b <= 0) break;
      ll n = -1;
      for (ll i = (a - c + b - 1) / b; i <= a / b; i++) {
        if (i > 0) {
          n = i;
          break;
        }
      }
      a -= b * n;
      a += d;
    }
    if (ct == -1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
