#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long double EPS = 1e-6;
int main() {
  int T;
  cin >> T;
  while (T--) {
    unordered_set<long long> s;
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    int st = clock();
    if (b > a) {
      cout << "No" << endl;
      continue;
    } else if (b > d) {
      cout << "No" << endl;
      continue;
    } else if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    long long cur = a % b;
    while (cur <= c) cur += b;
    bool ans = false;
    while (true) {
      if ((clock() - st) / (double)CLOCKS_PER_SEC >= 1.8 / T) {
        ans = false;
        break;
      }
      if (cur < 0) {
        ans = false;
        break;
      }
      cur %= b;
      while (cur <= c) cur += b;
      cur -= b;
      if (cur < 0) {
        ans = false;
        break;
      }
      if (cur <= c) cur += d;
      if (s.count(cur)) {
        ans = true;
        break;
      }
      if (cur < 0) {
        ans = false;
        break;
      }
      s.insert(cur);
    }
    if (ans)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
