#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int T;
long long a, b, c, d;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%lld %lld %lld %lld", &a, &b, &c, &d);
    if (a < b || d < b) {
      printf("No\n");
      continue;
    }
    a %= b;
    d %= b;
    if (d == 0) {
      if (a > c && a < b) {
        printf("No\n");
      } else
        printf("Yes\n");
    } else {
      if (a < c) a = a + d - b;
      a %= b;
      if (a < 0) a += b;
      long long x = (c - a) / d;
      ++x;
      if (x * d + a < b) {
        printf("No\n");
      } else {
        printf("Yes\n");
      }
    }
  }
  return 0;
}
