#include <bits/stdc++.h>
using namespace std;
const int INF = 100000000;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
bool isDebugMode = true;
long long t, a, b, c, d;
int main() {
  cin >> t;
  for (int p = 0; p < t; p++) {
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    }
    if (b <= c) {
      cout << "Yes" << endl;
      continue;
    }
    long long n = a;
    n -= b * (n / b - 1);
    set<long long> s{n};
    int q = 0;
    while (true) {
      if (n < b) {
        cout << "No" << endl;
        break;
      }
      n -= b * (n / b);
      q++;
      if (n <= c) {
        n += d;
      }
      if (s.find(n) != s.end()) {
        cout << "Yes" << endl;
        break;
      }
      if (q > 100000) {
        if ((b - c) > (d - b))
          cout << "No" << endl;
        else
          cout << "Yes" << endl;
        break;
      }
      s.insert(n);
    }
  }
  return 0;
}
