#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int T;
  int A, B, C, D = 0;
  cin >> T;
  for (int i = 1; i <= T; i++) {
    cin >> A >> B >> C >> D;
    int N1 = A;
    int k = 0;
    for (int j = 1; j <= 1000000000; j++) {
      N1 -= B;
      if (N1 < 0) break;
      if (N1 <= C) {
        N1 += D;
      }
      k++;
    }
    if (k == 1000000000) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
