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