#include <bits/stdc++.h>
using namespace std;
void smain();
int main() {
  ios::sync_with_stdio(false);
  smain();
  return 0;
}
const int cnt = 1e8 / 300;
void smain() {
  int T;
  long long A, B, C, D, E;
  long long k;
  cin >> T;
  while (T--) {
    cin >> A >> B >> C >> D;
    bool flag = true;
    for (int i = 0; i < cnt; ++i) {
      if (A < B) {
        flag = false;
        break;
      }
      if (A <= C) {
        if (B == D) break;
        if (B > D) {
          flag = false;
          break;
        }
        k = (C - A) / (D - B) + 1;
        A += (k * (D - B));
      } else {
        k = (A - C - 1) / B + 1;
        A -= (k * B);
        if (A < 0) {
          flag = false;
          break;
        }
        A += D;
      }
    }
    if (flag)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
