#include <bits/stdc++.h>
using namespace std;
const long long int inf = (1LL << 60);
const long long int mod = 1000000007;
long long int max(long long int a, long long int b) {
  if (a < b)
    return b;
  else
    return a;
}
long long int min(long long int a, long long int b) {
  if (a < b)
    return a;
  else
    return b;
}
int main() {
  long long int T;
  cin >> T;
  for (int i = 0; i < (T); i++) {
    long long int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B || D < B)
      cout << "No" << endl;
    else if (C >= B)
      cout << "Yes" << endl;
    else {
      long long int x1 = A % B;
      long long int lindex = 0, rindex = 2 * (1e+20);
      bool flag = true;
      while (rindex - lindex > 1) {
        long long int mid = (lindex + rindex) / 2;
        if (x1 + mid * ((D - B) % B) <= C) {
          lindex = mid;
        } else if (x1 + mid * ((D - B) % B) >= B) {
          rindex = mid;
        } else {
          flag = false;
          break;
        }
      }
      if (flag)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
  return 0;
}
