#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using ll = long long;
using pllll = pair<ll, ll>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using pqi = priority_queue<int>;
using pqd = priority_queue<double>;
using pqll = priority_queue<ll>;
using pqvi = priority_queue<vi>;
using pqvll = priority_queue<vll>;
int main() {
  int T;
  cin >> T;
  vvll v;
  for (int(i)(0); (i) < (T); ++(i)) {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    v.push_back({a, b, c, d});
  }
  for (unsigned(i)(0); (i) < (v.size()); ++(i)) {
    ll a = v[i][0], b = v[i][1], c = v[i][2], d = v[i][3];
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    } else if (a % b == 0 && d % b == 1) {
      if (b - 1 > c) {
        cout << "No" << endl;
        continue;
      }
    } else if (d % b == 0) {
      if (a % b > c) {
        cout << "No" << endl;
        continue;
      }
    } else if (b - (b - 1 - a % b) % (d % b) - 1 > c) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
}
