#include <bits/stdc++.h>
using namespace std;
constexpr int dx[4] = {0, 1, 0, -1};
constexpr int dy[4] = {1, 0, -1, 0};
constexpr long double pi = M_PI;
constexpr double eps = 1e-10;
constexpr long mod = 1000000007;
constexpr short shINF = 32767;
constexpr long loINF = 2147483647;
constexpr long long llINF = 9223372036854775807;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long T, A, B, C, D, init, k, l, t, dif;
  cin >> T;
  for (long long i = 0; i < (T); i++) {
    cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      cout << "No" << endl;
      continue;
    }
    if (A > C) {
      init = C + ((A - C) % B);
      if (init != C) init -= B;
      if (init < 0) {
        cout << "No" << endl;
        continue;
      }
    } else
      init = A;
    dif = (D - B);
    if (C >= (B - 1) || dif == 0) {
      cout << "Yes" << endl;
      continue;
    }
    t = init;
    if (C + dif < B) {
      cout << "No" << endl;
      continue;
    }
    while (1) {
      k = (C - ((C - t) % dif));
      if (k + dif < B) {
        cout << "No" << endl;
        break;
      }
      l = B - ((B - i) % dif);
      i = (l + dif) % B;
      if ((init - i) % dif == 0) {
        cout << "Yes" << endl;
        break;
      }
    }
  }
}
