#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int x, long long int y) {
  long long int r;
  if (x == 0 || y == 0) return 0;
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
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 || d < b) {
      cout << "No" << endl;
      continue;
    }
    if (b <= c) {
      cout << "Yes" << endl;
      continue;
    }
    if (b == 1) {
      cout << "Yes" << endl;
      continue;
    }
    if (d % b == 0 && a % b > c) {
      cout << "No" << endl;
      continue;
    } else if (d % b == 0) {
      cout << "Yes" << endl;
      continue;
    }
    d = d % b;
    long long gc = gcd(b, d);
    if (b - c - 1 >= gc) {
      cout << "No" << endl;
      continue;
    }
    bool flag = true;
    if ((c + 1) % gc <= a % gc && a % gc <= gc - 1) {
      cout << "No" << endl;
      continue;
    }
    if (flag) {
      cout << "Yes" << endl;
      continue;
    } else {
      cout << "No" << endl;
      continue;
    }
  }
  return 0;
}
