#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  int T;
  cin >> T;
  for (int i = (int)(0), i_end = (int)(T); i < i_end; ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > a || b > d) {
      cout << "No" << endl;
      continue;
    }
    if (c > b) {
      cout << "Yes" << endl;
      continue;
    }
    long long aa = a - ((a - c - 1) / b + 1) * b;
    if (aa < 0) {
      cout << "No" << endl;
      continue;
    }
    a = aa + d;
    long long aaa = a - ((a - c - 1) / b + 1) * b;
    if (aaa < 0) {
      cout << "No" << endl;
      continue;
    }
    if (aa == aaa) {
      cout << "Yes" << endl;
    } else {
      long long diff = aaa - aa;
      long long z = (c - aa) / diff + 1;
      long long num = aa + diff * z;
      if (num < b) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
  return 0;
}
