#include <bits/stdc++.h>
using namespace std;
int T;
int A, B, C, D;
int f(int 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;
    int stock;
    stock = A;
    int mem[1000];
    mem[0] = A;
    int temp = 1;
    int flag = 0;
    stock = f(stock);
    mem[1] = stock;
    temp++;
    for (int j = 2; 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) {
          break;
        }
        stock = f(stock);
        mem[j] = stock;
        temp++;
      }
    }
  }
}
