#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 20;
const int MOD = 1e9 + 7;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < (t); i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b && d >= b) {
      cout << "Yes" << endl;
      continue;
    } else {
      long long A = a;
      long long E = A;
      bool f = true;
      for (int i = 0; i < ((1e5) * 8); i++) {
        long long x = (A - c) / b;
        E = A;
        if ((A - c) % b != 0) {
          x++;
        }
        A = A - x * b;
        if (A < 0) {
          printf("No\n");
          f = false;
          break;
        } else {
          A += d;
        }
        if (E == A) {
          break;
        }
      }
      if (f) printf("Yes\n");
      continue;
    }
  }
  return 0;
}
