#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  long long a, b, c, d;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    long long tmp1, tmp, tmp2;
    if (b > d) {
      cout << "No" << endl;
    } else {
      tmp2 = a - (a - c) / b * b;
      tmp2 += b;
      while (tmp2 > c) {
        tmp2 -= b;
      }
      a = tmp2;
      if (a < 0 || a + d < b) {
        cout << "No" << endl;
        continue;
      }
      if (d == b) {
        cout << "Yes" << endl;
        continue;
      }
      tmp = c - a;
      tmp1 = (d - b);
      tmp = ((tmp) / (tmp1) + 1) * (tmp1);
      if (a + tmp >= b)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
  return 0;
}
