#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cout.tie(nullptr);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool poss = (a >= b);
    a -= b * max(0ll, ((a - c) / b));
    if (a >= b && a > c) a -= b;
    if (d < b)
      poss = 0;
    else if (a > c && a < b)
      poss = 0;
    else if (d % b == 0) {
    } else if (c < b) {
      long long diff = d % b;
      long long l = (c - a + diff) / diff;
      long long r = (b - a - 1) / diff;
      if (r - l >= 0) poss = 0;
    }
    if (poss)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
