#include <bits/stdc++.h>
using namespace std;
void appleJuice(int a, int b, int c, int d) {
  int A = a - b;
  for (int k = 0; k < 50001; k++) {
    if (k < 50000) {
      if (A < c + 1) {
        A += d;
        if (A - b < 0) {
          cout << "No" << endl;
          return;
        } else {
          continue;
        }
      } else {
        A -= b;
        if (A < 0) {
          cout << "No" << endl;
          return;
        } else {
          continue;
        }
      }
    } else {
      if (A > 0) {
        cout << "Yes" << endl;
        return;
      } else {
        cout << "No" << endl;
        return;
      }
    }
  }
}
int main() {
  int T, a, b, c, d;
  cin >> T;
  for (int j = 0; j < T; j++) {
    cin >> a >> b >> c >> d;
    appleJuice(a, b, c, d);
  }
}
