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