#include <bits/stdc++.h>
using namespace std;
void print_pair(pair<int, int> a) {
  cerr << "(" << a.first << ", " << a.second << ") ";
}
template <int T1, int T2>
void print_2d(int a[T1][T2], int x, int y) {
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < y; j++) {
      cerr << a[i][j] << " ";
    }
    cerr << endl;
  }
}
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
int T;
long long A, B, C, D;
int main() {
  cin >> T;
  for (int i = 0; i < T; i++) {
    cin >> A >> B >> C >> D;
    if (A < B || D < B) {
      cout << "No" << endl;
      continue;
    }
    if (B <= C + 1) {
      cout << "Yes" << endl;
      continue;
    }
    long long g = gcd(B, D);
    long long m = A % B;
    m = m % g;
    if (((C + 1 - m) % g) == 0 || (C + 1 - m) / g < (B - 1 - m) / g) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
  return 0;
}
