#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;
    long long x;
    if (d != 0) {
      x = (c - a) / d;
      if ((x + 1) * d + a < b) {
        printf("No\n");
      } else {
        printf("Yes\n");
      }
    } else {
      if (a > c) {
        printf("No\n");
      } else {
        printf("Yes\n");
      }
    }
  }
  return 0;
}
