#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int x, long long int y) {
  if (y < x) swap(x, y);
  if (x == 0)
    return y;
  else
    return gcd(y % x, x);
}
int main() {
  long long int T;
  cin >> T;
  while (T--) {
    long long int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (D < B) {
      cout << "No" << endl;
      continue;
    }
    if (C >= B) {
      cout << "Yes" << endl;
      continue;
    }
    long long int g = gcd(B, D);
    long long int m = (((C + 1) - (A % g)) / g) * g + (A % g);
    if (C < m && m < B) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
