#include <bits/stdc++.h>
using namespace std;
long long T;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> T;
  for (long long i = 0, i_len = (T); i < i_len; ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    if (b > a) {
      cout << "No" << endl;
      continue;
    }
    if (b <= c) {
      cout << "Yes" << endl;
      continue;
    }
    long long t = d - b;
    long long aa = a % b;
    if (c < aa && aa < b) {
      cout << "No" << endl;
      continue;
    }
    long long x = t != 0 ? (c - aa) / t : 0;
    long long ta = aa + t * (x + 1);
    if (c < ta && ta < b) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}
