#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int T;
  long long a[310];
  long long b[310];
  long long c[310];
  long long d[310];
  int ans = 0;
  cin >> T;
  for (int i = 0; i < T; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  for (int i = 0; i < T; i++) {
    if (a[i] < b[i]) {
      cout << "No" << endl;
    } else if (d[i] < b[i]) {
      cout << "No" << endl;
    } else if (c[i] >= b[i]) {
      cout << "Yes" << endl;
    } else if (b[i] == c[i] + 1) {
      cout << "Yes" << endl;
    } else {
      long long initial = a[i] % b[i];
      long long multi = d[i] % b[i];
      int flag = 1;
      long long range = b[i] - c[i] - 1;
      if (multi != 0) {
        if (range >= multi) {
          cout << "No" << endl;
        } else {
          long long rangel = c[i] % (2 * multi);
          long long ranger = b[i] % (2 * multi);
          if (initial % (2 * multi) < ranger &&
              rangel < (initial % (2 * multi))) {
            cout << "No" << endl;
          } else {
            cout << "Yes" << endl;
          }
        }
      } else {
        if (initial < b[i] && c[i] < initial) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      }
    }
  }
  return 0;
}
