#include <bits/stdc++.h>
using namespace std;
long long dx[] = {1, 1, 0, -1, -1, -1, 0, 1};
long long dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
long long prime(long long x) {
  long long i;
  if (x < 2)
    return 0;
  else if (x == 2)
    return 1;
  if (x % 2 == 0) return 0;
  for (i = 3; i * i <= x; i += 2) {
    if (x % i == 0) return 0;
  }
  return 1;
}
long long gcd(long long a, long long b) {
  if (a < b) {
    return gcd(b, a);
  } else if (a % b) {
    return gcd(b, a % b);
  } else {
    return b;
  }
}
long long combination(long long n, long long r) {
  if (r == 0) {
    return 1;
  } else {
    return combination(n, r - 1) * (n - r + 1) / r;
  }
}
long long MOD = 1000000007;
int main() {
  long long T;
  cin >> T;
  long long A[500], B[500], C[500], D[500];
  long long X[500];
  for (long long i = 0; i < T; i++) {
    cin >> A[i] >> B[i] >> C[i] >> D[i];
    X[i] = A[i];
  }
  long long min1 = 1000000000000000000;
  for (long long i = 0; i < T; i++) {
    if (A[i] < B[i]) {
      cout << "No" << endl;
    } else if (A[i] >= B[i]) {
      while ((A[i] - (A[i] / B[i]) * B[i]) <= C[i]) {
        long long cnt = 0;
        A[i] = ((A[i] - (A[i] / B[i]) * B[i]) + D[i]);
        min1 = min(min1, A[i]);
        break;
      }
      if (min1 - B[i] >= 0 && min1 <= C[i])
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
}
