#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  for (long long x = 1; x <= t; x++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    long long s = a, ans = 0;
    int f = 0;
    if (s < b) {
      f = 1;
    } else {
      s -= b;
    }
    while (s >= 0) {
      if (s == a && f != 1) {
        f = 233;
      }
      if (s <= c) {
        s += d;
        if (s < b) {
          break;
        }
      }
      ans++;
      if (s >= b)
        s %= b;
      else {
        f = 1;
        break;
      }
      if (ans == 23333) {
        break;
      }
    }
    if (f == 1) {
      cout << "No" << endl;
    } else if (f == 233) {
      cout << "Yes" << endl;
    } else if (ans == 23333) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
