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