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