#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long f = 1, x = 0;
  char c = getchar();
  while (c < '0' || '9' < c) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return f * x;
}
int t;
long long b, c, d;
vector<int> Hash[100 + 5][10007];
bool Hash_find(int x) {
  int tmp = x % 10007, siz = Hash[t][tmp].size();
  for (int i = 0; i < siz; i++)
    if (x == Hash[t][tmp][i]) return 1;
  Hash[t][tmp].push_back(x);
  return 0;
}
bool pan(long long a) {
  if (a < b) return 0;
  if (Hash_find(a)) return 1;
  if (a - b <= c) return pan(a - b + d);
  return pan(a - b);
}
int main() {
  long long T = read(), a;
  for (t = 1; t <= T; t++) {
    a = read(), b = read(), c = read(), d = read();
    if (d > b && a >= c && c >= b) {
      printf("Yes\n");
      continue;
    }
    if (d > b && a >= b && a <= c) {
      printf("Yes\n");
      continue;
    }
    if (a < b || d < b || c < b) {
      printf("No\n");
      continue;
    }
    a = a % b + (b + c - 1) / c * b, d = d % b + b;
    if (pan(a))
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
