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