#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MAX = 100005;
const int MAX1 = 2007;
const int MAX2 = 4007;
const int LEN = 21;
const int BASE = 1000000000;
const double EPS = 1e-7;
const int MOD = 1234567891;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ifstream in("");
  ofstream out("");
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool f = 0;
    for (int i = (0); i < (1000); ++i) {
      if (a - b >= 0) {
        a %= b;
        if (a <= c) a += d;
      } else {
        f = 1;
        break;
      }
    }
    if (f)
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
