#include <bits/stdc++.h>
using namespace std;
long long n, a, b, c, d, cnt = 1, tmp;
int main() {
  cin >> n;
  string ans[n];
  for (int i = 0; i < n; i++) {
    cin >> a >> b >> c >> d;
    if (a < b or a % b > c) {
      ans[i] = "No";
      continue;
    }
    if (d % b == 0) {
      ans[i] = "Yes";
      continue;
    }
    if (b - 1 <= c and b <= d) {
      ans[i] = "Yes";
      continue;
    }
    if (d == 1) {
      ans[i] = "No";
      continue;
    }
    if (c == 1) {
      ans[i] = "Yes";
      continue;
    }
    int aa = 1145140;
    bool f = true;
    while (aa--) {
      tmp = a;
      if (a < b) {
        ans[i] = "No";
        f = false;
        break;
      }
      a %= b;
      if (a <= c) {
        if (tmp > c) {
          a += d * ((c - a) / b + 1);
        } else {
          a += d * (tmp / b);
        }
      } else {
        ans[i] = "No";
        f = false;
        break;
      }
    }
    if (f == true) {
      ans[i] = "Yes";
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}
