#include <bits/stdc++.h>
using namespace std;
static const int INF = 1000010000;
static const long long MOD = 998244353;
int main() {
  int t;
  cin >> t;
  for (long long k = 0; k < (t); ++k) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d)
      cout << "No" << endl;
    else if (c >= b)
      cout << "Yes" << endl;
    else {
      unordered_map<long long, int> make_pair;
      make_pair[a] = 2;
      while (true) {
        long long x;
        if (a > c) {
          x = (a - c + b - 1) / b;
          a -= b * x;
        }
        if (a < 0) {
          cout << "No" << endl;
          break;
        } else {
          if (make_pair[a] == 2 || b == d) {
            cout << "Yes" << endl;
            break;
          } else {
            make_pair[a] = 2;
            a += d;
          }
        }
      }
    }
  }
}
