#include <bits/stdc++.h>
using namespace std;
long long func(long long i) {
  if (i > 0) return i;
  return 0;
}
int main(void) {
  int t;
  cin >> t;
  bool result[302] = {};
  for (int i = 0; i < t; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    map<long long, int> table;
    long long amari = a;
    amari = amari - b;
    bool skip;
    if (amari < 0) {
      skip = true;
      result[i] = false;
    } else {
      skip = false;
      amari = a - b * (func((a - c - 1) / b) + 1);
    }
    if (skip == false) {
      result[i] = true;
      while (true) {
        if (amari < 0) {
          result[i] = false;
          break;
        }
        amari += d;
        if (amari - b < 0) {
          skip = true;
          result[i] = false;
        }
        amari = amari - b * (func((amari - c - 1) / b) + 1);
        if (table[amari] != 0) {
          break;
        }
        table[amari] = 1;
      }
    }
  }
  for (int i = 0; i < t; i++) {
    if (result[i] == false) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
