#include <bits/stdc++.h>
using namespace std;
int T;
long A, B, C, D;
long f(long stock) {
  int temp = (B + C - stock) / (D - B) + 1;
  return stock + temp * (D - B) - B;
}
int main() {
  cin >> T;
  for (int k = 0; k < T; k++) {
    cin >> A >> B >> C >> D;
    long stock;
    stock = A;
    long mem[1000];
    mem[0] = A;
    int temp = 0;
    int flag = 0;
    for (int j = 1; j < 1000; j++) {
      if (stock < B) {
        cout << "No" << endl;
        break;
      } else {
        for (int i = 0; i < temp; i++) {
          if (stock == mem[i]) {
            cout << "Yes" << endl;
            flag = 1;
            break;
          }
        }
        if (flag == 1) {
          flag = 0;
          break;
        }
        stock = f(stock);
        mem[j] = stock;
        temp++;
      }
    }
  }
}
