#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  long long int a, b, c, d;
  long long int tank;
  long long int cul;
  long long int memory;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    tank = a;
    while (1) {
      if (tank - c > b * 100000000000000000) {
        tank -= b * 100000000000000000;
      } else if (tank - c > b * 10000000000000000) {
        tank -= b * 10000000000000000;
      } else if (tank - c > b * 1000000000000000) {
        tank -= b * 1000000000000000;
      } else if (tank - c > b * 100000000000000) {
        tank -= b * 100000000000000;
      } else if (tank - c > b * 10000000000000) {
        tank -= b * 10000000000000;
      } else if (tank - c > b * 1000000000000) {
        tank -= b * 1000000000000;
      } else if (tank - c > b * 100000000000) {
        tank -= b * 100000000000;
      } else if (tank - c > b * 10000000000) {
        tank -= b * 10000000000;
      } else if (tank - c > b * 1000000000) {
        tank -= b * 1000000000;
      } else if (tank - c > b * 100000000) {
        tank -= b * 100000000;
      } else if (tank - c > b * 10000000) {
        tank -= b * 10000000;
      } else if (tank - c > b * 1000000) {
        tank -= b * 1000000;
      } else if (tank - c > b * 100000) {
        tank -= b * 100000;
      } else if (tank - c > b * 10000) {
        tank -= b * 10000;
      } else if (tank - c > b * 1000) {
        tank -= b * 1000;
      } else if (tank - c > b * 100) {
        tank -= b * 100;
      } else {
        tank -= b;
      }
      if (c >= tank) {
        tank += b;
        break;
      }
    }
    memory = b;
    if (d >= b) {
      for (int k = 0; k < b; k++) {
        cul = (tank - c + (d - b) * k);
        if (0 < cul % b && cul % b < memory) {
          memory = cul % b;
        }
      }
    }
    if (memory + c - b >= 0 && d >= b && a - b >= 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
