#include <bits/stdc++.h>
using namespace std;
const long long int inf = 2222222222222222222LL;
const long long int mod = 1000000007LL;
const double pi = acos(-1);
const double eps = 1e-10;
long long int n = 0, m = 0, ans = 0, cnt = 0, tmp = 0, ma = -inf, mi = inf;
string s;
bool ok, flag;
long long int dx[5] = {1, -1, 0, 0, 0}, dy[5] = {0, 0, 1, -1, 0};
long long int ddx[9] = {1, -1, 0, 0, 1, 1, -1, -1, 0},
              ddy[9] = {0, 0, 1, -1, 1, -1, 1, -1, 0};
int main(void) {
  long long int t, a, b, c, d;
  cin >> t;
  for (long long int i = (long long int)(0LL); i < (long long int)(t); i++) {
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    a %= b;
    d %= b;
    if (d == 0) d = b;
    tmp = c - a;
    if (tmp >= 0)
      ans = a + (tmp / d + 1) * d;
    else
      ans = a;
    if (ans < b)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
