#include <bits/stdc++.h>
using namespace std;
int main() {
  long long T;
  cin >> T;
  for (int tc = 0; tc < (int)T; tc++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cerr << "NO " << 17 << endl;
      cout << "No" << endl;
      continue;
    }
    long long diff = a - c;
    long long n = diff / b;
    if (diff % b) n++;
    if (diff <= 1) {
      n = 1;
    }
    assert(a - b * n <= c);
    long long now = a - b * n;
    if (now < 0 || now + d < b) {
      cerr << "NO " << 31 << endl;
      cout << "No" << endl;
      continue;
    }
    if (now + d < c) {
      cout << "No" << endl;
      continue;
    }
    long long diff2 = (now + d) - c;
    long long n2 = diff2 / b;
    if (diff2 % b) n2++;
    assert(now + d - b * n2 <= c);
    long long now2 = now + d - b * n2;
    if (now2 < 0 || now2 + d < b) {
      cerr << "NO " << 45 << endl;
      cout << "No" << endl;
      continue;
    }
    long long diff3 = abs(now - now2);
    if (diff3 == 0) {
      cerr << "yes " << 51 << endl;
      cout << "Yes" << endl;
      continue;
    }
    long long hoge = abs(now - c) / diff3 + 1;
    long long huga = now + hoge * diff3;
    assert(huga > c);
    if (huga < b) {
      cerr << "NO " << 59 << endl;
      cout << "No" << endl;
      continue;
    }
    cerr << "yes " << 63 << endl;
    cout << "Yes" << endl;
  }
  return 0;
}
