#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d, tmp;
    cin >> a >> b >> c >> d;
    tmp = a;
    if (b > d) {
      cout << "No\n";
      continue;
    }
    long long cnt = 0;
    while (1) {
      if (cnt == 50000) break;
      if (a >= b) {
        a -= b;
      } else {
        cout << "No\n";
        break;
      }
      if (a <= c) a += d;
      cnt++;
    }
    if (cnt != 50000) continue;
    a %= b;
    a += (c / b + 1) * b;
    a = max(tmp, a);
    cnt = 0;
    while (1) {
      if (cnt == 50000) {
        break;
      }
      if (a >= b) {
        a -= b;
      } else {
        cout << "No\n";
        break;
      }
      if (a <= c) a += d;
      cnt++;
    }
    if (cnt == 50000) cout << "Yes\n";
  }
  return 0;
}
