#include <bits/stdc++.h>
using namespace std;
map<int, bool> bio;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cout.precision(10);
  cout << fixed;
  int q;
  cin >> q;
  while (q--) {
    bio.clear();
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (d < b) {
      cout << "No\n";
      continue;
    }
    if (b > a) {
      cout << "No\n";
      continue;
    }
    if (c >= b && d >= b) {
      cout << "Yes\n";
      continue;
    }
    long long x = a - c;
    long long treba = x / b;
    if (x % b) treba++;
    if (a - treba * b < 0) {
      cout << "No\n";
      continue;
    }
    long long rez = a - (treba * b) + d;
    if (rez < b) {
      cout << "No\n";
      continue;
    }
    if (rez == a) {
      cout << "Yes\n";
      continue;
    }
    long long del = rez - a;
    if (abs(del) < b - c) {
      cout << "No\n";
      continue;
    }
    cout << "Yes\n";
  }
  return 0;
}
