#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0 || b == 0) {
    return 0;
  }
  while (a % b) {
    a = a % b;
    swap(a, b);
  }
  return b;
}
int main() {
  long long t;
  cin >> t;
  for (signed long long k = 0; k < (t); k++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > d || b > a) {
      cout << "No" << endl;
      continue;
    }
    if (c + 1 >= b) {
      cout << "Yes" << endl;
      continue;
    }
    long long z = a % b;
    long long g = gcd(b, d);
    if ((b - 1 - z) == (c + 1 - z)) {
      if ((b - 1 - z) % g == 0) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    } else if ((b - 1 - z) / g > (c + 1 - z) / g || (c + 1 - z) % g == 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
}
