#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9, MOD = 1e9 + 7, ohara = 1e6;
const long long LINF = 1e18;
long long int n, cnt = 0, ans = 0, a, b, c, d, cmp, cmpp, m, h, w, x, y,
                 sum = 0, pos, t;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
bool fl = true;
struct edge {
  int to, cost;
};
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> t;
  for (long long int(i) = 0; (i) < (int)(t); (i)++) {
    cin >> a >> b >> c >> d;
    if (a < b)
      cout << ("No") << endl;
    else {
      long long first, iso, kaisu;
      pos = a / b;
      first = a - b * pos;
      iso = d - b;
      if (iso < 0)
        cout << ("No") << endl;
      else {
        if (iso == 0) {
          if (first < b && first > c)
            cout << ("No") << endl;
          else
            cout << ("Yes") << endl;
        } else {
          cnt = 1;
          while (1) {
            cnt++;
            if (cnt >= 10000) {
              cout << ("Yes") << endl;
              break;
            }
            kaisu = ((c - first) / iso) + 1;
            first += kaisu * iso;
            if (first < b) {
              cout << ("No") << endl;
              break;
            } else {
              first -= b;
            }
          }
        }
      }
    }
  }
  return 0;
}
