#include <bits/stdc++.h>
using namespace std;
template <class T>
void readi(T &x) {
  T input = 0;
  bool negative = false;
  char c = ' ';
  while (c < '-') {
    c = getchar();
  }
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  while (c >= '0') {
    input = input * 10 + (c - '0');
    c = getchar();
  }
  if (negative) {
    input = -input;
  }
  x = input;
}
template <class T>
void printi(T output) {
  if (output == 0) {
    putchar('0');
    return;
  }
  if (output < 0) {
    putchar('-');
    output = -output;
  }
  int aout[20];
  int ilen = 0;
  while (output) {
    aout[ilen] = ((output % 10));
    output /= 10;
    ilen++;
  }
  for (int i = ilen - 1; i >= 0; i--) {
    putchar(aout[i] + '0');
  }
  return;
}
template <class T>
void ckmin(T &a, T b) {
  a = min(a, b);
}
template <class T>
void ckmax(T &a, T b) {
  a = max(a, b);
}
long long randomize(long long mod) {
  return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}
const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-10;
long long normalize(long long x, long long mod = 1000000007) {
  return (((x % mod) + mod) % mod);
}
int T;
long long A, B, C, D;
set<long long> seen;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int32_t main() {
  ios_base::sync_with_stdio(0);
  srand(time(0));
  if (fopen("agc26b.in", "r")) {
    freopen("agc26b.in", "r", stdin);
  }
  cin >> T;
  while (T--) {
    cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      cout << "No\n";
      continue;
    }
    if (C + 1 >= B) {
      cout << "Yes\n";
      continue;
    }
    long long g = gcd(B, D);
    bool flag = true;
    if (B - 1 - (C + 1) + 1 >= g) {
      flag = false;
    }
    long long lo = (C + 1) % g, hi = (B - 1) % g;
    if (lo >= hi) {
      if (A % g >= lo || A % g <= hi) {
        flag = false;
      }
    } else {
      if (lo <= A % g && A % g <= hi) {
        flag = false;
      }
    }
    cout << (flag ? "Yes\n" : "No\n");
  }
  return 0;
}
