#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  long long a, b, c, d;
  for (int i = 0; i < (t); i++) {
    cin >> a >> b >> c >> d;
    if (a < b)
      cout << "No" << endl;
    else if (b > d)
      cout << "No" << endl;
    else if (b == d) {
      if (a - b > c)
        cout << "No" << endl;
      else
        cout << "Yes" << endl;
    } else if (c >= b) {
      cout << "Yes" << endl;
    } else {
      if (a % b > c)
        cout << "No" << endl;
      else {
        bool flg = true;
        for (long long j = c + 1; j < b; j++) {
          if (j % (d - b) == 0) {
            flg = false;
            break;
          }
        }
        if (flg)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      }
    }
  }
  return 0;
}
