#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, a, b, c, d;
  cin >> n;
  while (n--) {
    cin >> a >> b >> c >> d;
    if (a < b)
      cout << "No"
           << "\n";
    else if (d < b)
      cout << "No"
           << "\n";
    else if (a % b > c)
      cout << "No"
           << "\n";
    else if (b == d) {
      if (a - b > c)
        cout << "No"
             << "\n";
      else
        cout << "Yes"
             << "\n";
    } else if (a % (d - b) + 2 * b - d > c)
      cout << "No"
           << "\n";
    else
      cout << "Yes"
           << "\n";
  }
  return 0;
}
