#include <bits/stdc++.h>
using namespace std;
int T;
long long a, b, c, d;
int main() {
  scanf("%d", &T);
  while (T--) {
    cin >> a >> b >> c >> d;
    if (d < b || a < b) {
      printf("No\n");
      continue;
    }
    long long a1 = a - ((a - c + b - 1) / b) * b;
    if (a1 < 0) {
      printf("No\n");
      continue;
    }
    long long dt = d - b;
    if (dt == 0) {
      printf("Yes\n");
      continue;
    }
    long long l = (c + 1 - a1 + dt - 1) / dt;
    long long r = (b - 1 - a1) / dt;
    if (r >= l) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
  }
}
