#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = ((ans % m) * (a % m)) % m;
    b /= 2;
    a = ((a % m) * (a % m)) % m;
  }
  return ans % m;
}
int main() {
  int t;
  cin >> t;
  long long a, b, c, d;
  while (t--) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No"
           << "\n";
      continue;
    } else if (d < b) {
      cout << "No"
           << "\n";
      continue;
    }
    long long rem = (a % b);
    if (rem > c) {
      cout << "No"
           << "\n";
      continue;
    }
    if (c >= b && d >= b) {
      cout << "Yes"
           << "\n";
      continue;
    }
    if (d == b) {
      cout << "Yes"
           << "\n";
      continue;
    }
    long long st = rem;
    long long diff = (d - b);
    long long k = (c - rem) / (diff);
    long long rem1 = (c - rem) % (diff);
    k++;
    long long val = (rem + (d - b) * k);
    if (val > c && val < b) {
      cout << "No"
           << "\n";
      continue;
    }
    cout << "Yes"
         << "\n";
  }
}
