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