#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int INTMAX = 2147483647;
const int INTMIN = -2147483648;
const unsigned int UINTMAX = 4294967295;
const long LONGMAX = 9223372036854775807;
const long LONGMIN = -9223372036854775808;
const unsigned long ULONGMAX = 18446744073709551615;
bool isprime(int p) {
  if (p == 1) return false;
  for (int i = (2); i < (p); ++i) {
    if (p % i == 0) return false;
  }
  return true;
}
int dig(int n, int a) { return n / (int)pow(10, a) % 10; }
int digl(long n, int a) { return n / (long)pow(10, a) % 10; }
int digsum(int n) {
  int r = 0;
  for (int i = (0); i < (10); ++i) {
    r += dig(n, i);
  }
  return r;
}
int digsuml(long n) {
  int r = 0;
  for (int i = (0); i < (19); ++i) {
    r += digl(n, i);
  }
  return r;
}
int dignum(int n) { return n ? to_string(n).length() : 0; }
int dignuml(long n) { return n ? to_string(n).length() : 0; }
bool chk(long a, long b, long c, long d) {
  if (b == d) {
    return (0 < (a - c) % b && (a - c) % b < (b - c) % b);
  } else {
    long p = d - b;
    if (b - c > p) {
      return true;
    }
    if ((b - c) % p == 0) {
      return ((a - b - c) % p != 0);
    }
    return (0 < (a - b - c) % p && (a - b - c) % p < (b - c) % p);
  }
}
int main() {
  long t, a, b, c, d;
  cin >> t;
  for (int i = (0); i < (t); ++i) {
    cin >> a >> b >> c >> d;
    if (b > d || a < b) {
      cout << "No" << endl;
    } else {
      if (chk(a, b, c, d)) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
}
