#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long t;
  cin >> t;
  for (long long i = 0; i < (t); i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No" << endl;
    } else if (b <= c) {
      cout << "Yes" << endl;
    } else if ((a - c - 1) % b + c + 1 < b) {
      cout << "No" << endl;
    } else {
      for (long long i = 0; i < (10000); i++) {
        a = (a - c - 1) % b + c + 1 - b + d;
        if ((a - c - 1) % b + c + 1 < b) {
          cout << "No" << endl;
          break;
        }
        if (i == 9999) cout << "Yes" << endl;
      }
    }
  }
  return 0;
}
