#include <bits/stdc++.h>
using namespace std;
int main() {
  long long test_case;
  cin >> test_case;
  for (long long hoge = 0; hoge < test_case; ++hoge) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    a %= b;
    d %= b;
    long long left = max(-1LL, c - a);
    long long right = b - a;
    long long mod = b;
    long long aa = 0;
    while (d >= 2) {
      right -= left / d * d;
      left -= left / d * d;
      if (right - left >= d + 1) {
        cout << "No" << endl;
        aa = 1;
        break;
      }
      long long geko = mod / d * d;
      geko %= mod;
      if (geko + d >= mod) {
        geko += d;
      }
      geko %= mod;
      if (geko == 0) break;
      d = geko;
    }
    if (aa == 1) continue;
    if (d == 0) {
      if (left == -1 && right != 0) {
        cout << "No" << endl;
        continue;
      }
      cout << "Yes" << endl;
      continue;
    }
    if (right - left >= d + 1) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
  return 0;
}
