#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long a, b, c, d, x, y, z;
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    x = a % b;
    y = a;
    z = ((x + d) % b) - x;
    if (b > d || x > c || a < b) {
      cout << "No" << endl;
      continue;
    }
    if (z == 0) {
      cout << "Yes" << endl;
      continue;
    }
    bool first = true;
    int ct = 0;
    while (1) {
      y %= b;
      if ((x - y) % z == 0) {
        if (first)
          first = false;
        else {
          cout << "Yes" << endl;
          break;
        }
      }
      long long aa = b - y;
      if (aa % z == 0)
        y = b - z;
      else
        y += aa / z * z;
      if (y > c) {
        cout << "No" << endl;
        break;
      }
      y += d;
      if (ct >= 1000) {
        cout << "No" << endl;
        break;
      }
      ct++;
    }
  }
  return 0;
}
