#include <bits/stdc++.h>
namespace ZDY {}
namespace FAST {
namespace fib {
char b[300000] = {}, *f = b;
}
inline void in(long long &x) {
  x = 0;
  char c;
  bool f = 0;
  while ((c = ((*fib::f) ? (*(fib ::f++))
                         : (fgets(fib::b, sizeof(fib::b), stdin)
                                ? (fib::f = fib::b, *(fib::f++))
                                : -1))) > '9' ||
         c < '0')
    if (c == '-') f = !f;
  x = c - 48;
  while ((c = ((*fib::f) ? (*(fib ::f++))
                         : (fgets(fib::b, sizeof(fib::b), stdin)
                                ? (fib::f = fib::b, *(fib::f++))
                                : -1))) <= '9' &&
         c >= '0')
    x = x * 10 + c - 48;
  if (f) x = -x;
}
inline void in(int &x) {
  x = 0;
  char c;
  bool f = 0;
  while ((c = ((*fib::f) ? (*(fib ::f++))
                         : (fgets(fib::b, sizeof(fib::b), stdin)
                                ? (fib::f = fib::b, *(fib::f++))
                                : -1))) > '9' ||
         c < '0')
    if (c == '-') f = !f;
  x = c - 48;
  while ((c = ((*fib::f) ? (*(fib ::f++))
                         : (fgets(fib::b, sizeof(fib::b), stdin)
                                ? (fib::f = fib::b, *(fib::f++))
                                : -1))) <= '9' &&
         c >= '0')
    x = x * 10 + c - 48;
  if (f) x = -x;
}
namespace fob {
char b[300000] = {}, *f = b, *g = b + 300000 - 2;
}
struct foce {
  ~foce() {
    (fwrite(fob::b, sizeof(char), fob::f - fob::b, stdout), fob::f = fob::b, 0);
    fflush(stdout);
  }
} _foce;
namespace ib {
char b[100];
}
inline void out(long long x) {
  if (x == 0) {
    (*(fob::f++) = (48), (fob::f == fob::g) ? (fwrite(fob::b, sizeof(char),
                                                      fob::f - fob::b, stdout),
                                               fob::f = fob::b, 0)
                                            : 0);
    return;
  }
  if (x < 0) {
    (*(fob::f++) = ('-'), (fob::f == fob::g) ? (fwrite(fob::b, sizeof(char),
                                                       fob::f - fob::b, stdout),
                                                fob::f = fob::b, 0)
                                             : 0);
    x = -x;
  }
  char *s = ib::b;
  while (x) *(++s) = x % 10, x /= 10;
  while (s != ib::b)
    (*(fob::f++) = ((*(s--)) + 48),
     (fob::f == fob::g)
         ? (fwrite(fob::b, sizeof(char), fob::f - fob::b, stdout),
            fob::f = fob::b, 0)
         : 0);
}
inline void outn(long long x) {
  out(x);
  (*(fob::f++) = ('\n'),
   (fob::f == fob::g) ? (fwrite(fob::b, sizeof(char), fob::f - fob::b, stdout),
                         fob::f = fob::b, 0)
                      : 0);
}
inline void out(int x) {
  if (x == 0) {
    (*(fob::f++) = (48), (fob::f == fob::g) ? (fwrite(fob::b, sizeof(char),
                                                      fob::f - fob::b, stdout),
                                               fob::f = fob::b, 0)
                                            : 0);
    return;
  }
  if (x < 0) {
    (*(fob::f++) = ('-'), (fob::f == fob::g) ? (fwrite(fob::b, sizeof(char),
                                                       fob::f - fob::b, stdout),
                                                fob::f = fob::b, 0)
                                             : 0);
    x = -x;
  }
  char *s = ib::b;
  while (x) *(++s) = x % 10, x /= 10;
  while (s != ib::b)
    (*(fob::f++) = ((*(s--)) + 48),
     (fob::f == fob::g)
         ? (fwrite(fob::b, sizeof(char), fob::f - fob::b, stdout),
            fob::f = fob::b, 0)
         : 0);
}
inline void outn(int x) {
  out(x);
  (*(fob::f++) = ('\n'),
   (fob::f == fob::g) ? (fwrite(fob::b, sizeof(char), fob::f - fob::b, stdout),
                         fob::f = fob::b, 0)
                      : 0);
}
inline char sc() {
  char c = ((*fib::f) ? (*(fib ::f++))
                      : (fgets(fib::b, sizeof(fib::b), stdin)
                             ? (fib::f = fib::b, *(fib::f++))
                             : -1));
  while (
      !(('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z') || ('0' <= c <= '9')))
    c = ((*fib::f) ? (*(fib ::f++))
                   : (fgets(fib::b, sizeof(fib::b), stdin)
                          ? (fib::f = fib::b, *(fib::f++))
                          : -1));
  return c;
}
}  // namespace FAST
using namespace FAST;
using namespace ZDY;
using namespace std;
long long t, a, b, c, d, k = 0, p[3000 * 2 + 10];
inline bool judge() {
  for (int i = 1000; i <= (k >> 1); i++) {
    int r = k - i + 1, l = k - i * 2 + 1, o = 1;
    while (r != k)
      if (p[l++] != p[r++]) {
        o = 0;
        break;
      }
    if (o) return 1;
  }
  return 0;
}
int main() {
  in(t);
  while (t--) {
    in(a), in(b);
    in(c), in(d);
    k = 0;
    while (1) {
      p[++k] = a;
      if (k >= 7000 && judge()) {
        printf("Yes\n");
        break;
      }
      if (k >= 10000) {
        printf("No\n");
        break;
      }
      if (a > b * 2) {
        int u = a / b;
        a %= b;
        while (a <= c && u--) a += b;
      }
      a -= b;
      if (a < 0) {
        printf("No\n");
        break;
      }
      if (a <= c) a += d;
    }
  }
}
