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