#include <bits/stdc++.h>
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int ddx[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
bool debug = false;
void solve(long long a, long long b, long long c, long long d) {
  for (int i = 0; i < 1000; i++) {
    if (a < b) {
      cout << "No" << endl;
      return;
    }
    a = a % b;
    if (c + 1 <= a && a <= d - 1) {
      cout << "No" << endl;
      return;
    }
    a += d;
  }
  cout << "Yes" << endl;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    solve(a, b, c, d);
  }
  return 0;
}
