#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double EPS = 1e-9;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1},
          dy[] = {0, -1, 0, 1, 1, -1, -1, 1};
long long gcd(long long a, long long b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
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) {
      cout << "No" << endl;
      continue;
    }
    if (d < b) {
      cout << "No" << endl;
      continue;
    }
    if (b <= c) {
      cout << "Yes" << endl;
      continue;
    }
    if ((a % b) > c) {
      cout << "No" << endl;
      continue;
    }
    if (d % b == 0) {
      cout << "Yes" << endl;
      continue;
    }
    if (c % b == b - 1) {
      cout << "Yes" << endl;
      continue;
    }
    if (b % (d % b) == 0) {
      long long k = (c - (a % b) + 2 * b) % b / (d % b);
      long long A = a % b + (k + 1) * (d % b);
      if (A % b > c) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
      continue;
    }
    cout << "No" << endl;
  }
  return 0;
}
