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