#include <bits/stdc++.h>
using namespace std;
bool check(long long int now, vector<long long int> stock, long long int i) {
  for (int j = 0; j < i; j++) {
    if (now == stock[j]) {
      return true;
    } else if (now < stock[j])
      break;
  }
  return false;
}
int main() {
  long long int T, A, B, C, D, num, i = 0;
  bool flag;
  vector<long long int> stock;
  cin >> T;
  for (int t = 0; t < T; t++) {
    cin >> A >> B >> C >> D;
    num = A;
    i = 0;
    flag = false;
    long long int x = A / B;
    while (1) {
      if (x != 0) {
        while (num - x * B <= C && x > 0) {
          x--;
        }
      }
      num = num - x * B;
      if (num == 0 || x <= 0) {
        num += x * B;
      }
      if (!stock.empty() && flag) {
        sort(stock.begin(), stock.end());
        if (check(num, stock, i)) {
          cout << "Yes" << endl;
          stock.clear();
          break;
        }
        flag = false;
      }
      stock.push_back(num);
      i++;
      if (num < B) {
        cout << "No" << endl;
        stock.clear();
        break;
      } else {
        num = num - B;
      }
      if (num <= C) {
        num += D;
        flag = true;
      }
    }
  }
  return 0;
}
