#include <bits/stdc++.h>
using namespace std;
int dx[8] = {0, 0, -1, 1, 1, 1, -1, -1};
int dy[8] = {-1, 1, 0, 0, 1, -1, 1, -1};
const int SIZE = 1050;
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (D < B) {
      cout << "No" << endl;
      continue;
    }
    if (C >= B) {
      cout << "Yes" << endl;
      continue;
    }
    bool flag = 1;
    for (int i = 0; i < 100000; i++) {
      A %= B;
      if (A > C) {
        flag = 0;
        break;
      }
      A += D;
    }
    cout << (flag ? "Yes" : "No") << endl;
  }
  return 0;
}
