#include <bits/stdc++.h>
using namespace std;
int64_t gcd(int64_t a, int64_t b) {
  while (b) {
    int64_t c = a % b;
    a = b;
    b = c;
  }
  return a;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T-- > 0) {
    int64_t a, b, c, d;
    cin >> a >> b >> c >> d;
    if (d < b || a < b) {
      cout << "No\n";
      continue;
    }
    int64_t g = gcd(b, d);
    a %= g;
    a += (b - 1) / g * g;
    if (a > c) {
      cout << "No\n";
      continue;
    }
    cout << "Yes\n";
  }
}
