#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1, 0, 0}, dy[] = {0, 1, 0, -1, 0};
long long int t, n, a, b, c, d, r, m, l, k;
int main() {
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    n = b;
    r = d;
    while (r > 0) {
      long long int p = r;
      r = n % r;
      n = p;
    }
    m = a % n;
    if (m == 0) {
      m = n;
    }
    k = ((c - b) + m * abs(b - c)) % m;
    if (k == 0) {
      k = m;
    }
    if (0 > c - b + k) {
      l = 0;
    } else {
      l = 1;
    }
    if (a < b) {
      cout << "No" << endl;
    } else if (d < b) {
      cout << "No" << endl;
    } else if (c >= b) {
      cout << "Yes" << endl;
    } else if (l) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
