#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
int main() {
  int q;
  cin >> q;
  while (q--) {
    long long int a, b, c, d;
    cin >> a >> b >> c >> d;
    bool F = true;
    if (a < b) {
      cout << "No\n";
      continue;
    }
    if (c >= a) {
      cout << "Yes\n";
      continue;
    }
    long long int p = a % b;
    if (b > d || p + d < b)
      F = false;
    else if (d % b == 0 && p <= c) {
    } else {
      long long int x = d % b;
      long long int s = x;
      if (x) s -= c % x;
      c += s;
      if (c < b) F = false;
    }
    if (F)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
