#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  long long a[305], b[305], c[305], d[305];
  long long tmp;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
    if (a[i] >= b[i] && d[i] >= b[i]) {
      bool k[b[i]];
      for (long long j = 0; j < b[i]; j++) {
        k[j] = false;
      }
      tmp = a[i] % b[i];
      k[tmp] = true;
      while (true) {
        tmp = (tmp + (d[i] - b[i])) % b[i];
        if (tmp > c[i] && b[i] > tmp) {
          cout << "No" << endl;
          break;
        } else if (k[tmp] == true) {
          cout << "Yes" << endl;
          break;
        }
        k[tmp] = true;
      }
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
