#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  long long int a, b, c, d;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b && d >= b) {
      cout << "Yes" << endl;
      continue;
    }
    if (c >= b && d < b) {
      cout << "No" << endl;
      continue;
    }
    if (d < b) {
      cout << "No" << endl;
      continue;
    }
    bool ans = false;
    long long int nkl = a;
    int pt = nkl % b;
    int k = 0;
    long long int x = d % b + b;
    while (true) {
      if (nkl / b > 0) {
        nkl = nkl % b;
      } else {
        nkl -= b;
      }
      if (nkl < 0) {
        break;
      }
      if (nkl == pt && k != 0) {
        ans = true;
        break;
      }
      k++;
      if (nkl <= c) {
        if (d / b > 0) {
          nkl += (x);
        } else {
          nkl += d;
        }
      }
    }
    if (ans) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
