#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long mod = 1e9 + 7;
const long long mod1 = 998244353;
const long long big = 1e18;
const double PI = 2 * asin(1);
int main() {
  int T;
  cin >> T;
  long long A, B, C, D;
  long long x, y;
  bool can[T];
  for (int i = 0; i < T; ++i) {
    cin >> A >> B >> C >> D;
    if (A - B < 0) {
      can[i] = false;
      continue;
    }
    if (A <= C) {
      x = 1;
    } else {
      if ((A - C) % B == 0)
        x = (A - C) / B;
      else
        x = (A - C) / B + 1;
    }
    if (B > D) {
      can[i] = false;
      continue;
    } else if (B == D) {
      if (A - B * x >= 0)
        can[i] = true;
      else
        can[i] = false;
      continue;
    } else {
      if (A - B * x < 0) {
        can[i] = false;
        continue;
      }
      if ((C - (A - B * x)) % (D - B) == 0) {
        y = (C - (A - B * x)) / (D - B) + 1;
      } else {
        y = (C - (A - B * x)) / (D - B) + 1;
      }
      if (A - B * x + (D - B) * y >= B)
        can[i] = true;
      else
        can[i] = false;
    }
  }
  for (int i = 0; i < T; ++i) {
    if (can[i])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
