#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-9;
const int INF = 1e9 + 7;
const long long LINF = 8e18 + 7;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  int t;
  cin >> t;
  for (int _ = 0; _ < (int)(t); ++_) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (D < B) {
      cout << "No" << endl;
      continue;
    }
    long long day = A;
    set<long long> was;
    bool f = true;
    while (1) {
      if (day < B) {
        f = false;
        break;
      }
      if (was.count(day)) {
        f = true;
        break;
      }
      was.insert(day);
      long long x = day - (max(1ll, day - C) + B - 1) / B * B;
      if (x < 0) {
        f = false;
        break;
      }
      day = x + D;
    }
    if (f) {
      cout << "Yes";
    } else {
      cout << "No";
    }
    cout << endl;
  }
}
