#include <bits/stdc++.h>
using namespace std;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
constexpr long long INF = 1000000000000000000;
int t;
long long a, b, c, d;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> t;
  for (int tt = 0; tt < t; ++tt) {
    bool flag = true;
    cin >> a >> b >> c >> d;
    long long temp = a;
    long long dec = b;
    for (int z = 0; z < 100000; ++z) {
      while (1) {
        if (temp - dec > c) {
          temp -= dec;
          if (dec < INF) dec *= 2;
        } else if (dec != b) {
          dec /= 2;
        } else {
          break;
        }
      }
      if (temp - b < 0) {
        flag = false;
        break;
      } else {
        temp = temp - b + d;
        dec = b;
      }
    }
    if (flag)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
