#include <bits/stdc++.h>
using namespace std;
bool check(long long a, long long b, long long c, long long d) {
  if (a < b || d < b) return false;
  if (c + 1 >= b) return true;
  map<long long, int> q;
  while (!q[a]) {
    q[a] = 1;
    if (a - c >= b)
      a -= (a - c) / b * b;
    else
      a -= b;
    if (a > c) a -= b;
    if (a < 0) return false;
    a += d;
  }
  return true;
}
int main() {
  int t;
  long long a, b, c, d;
  scanf("%d", &t);
  while (t--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (check(a, b, c, d)) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
}
