#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans[300] = {};
  for (int q = 0; q < n; q++) {
    long long a, b, c, d;
    long long tmp1, tmp2;
    cin >> a >> b >> c >> d;
    if (a < b) {
      ans[q] = 0;
    } else {
      a = a % b;
      tmp1 = d - b;
      if (tmp1 > 0) {
        tmp2 = (c - a) / tmp1;
        tmp2++;
        if (a + tmp1 * tmp2 < b) {
          ans[q] = 0;
        } else {
          ans[q] = 1;
        }
      } else if (tmp1 == 0) {
        if (a > c) {
          ans[q] = 0;
        } else {
          ans[q] = 1;
        }
      } else {
        ans[q] = 0;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (ans[i] == 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
