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