#include <bits/stdc++.h>
using namespace std;
const int INF = 987654321;
const long long MOD = 1000000007;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << "No" << endl;
      continue;
    } else if (B > D) {
      cout << "No" << endl;
      continue;
    } else if (B <= D && B <= C) {
      cout << "Yes" << endl;
      continue;
    }
    long long a, d;
    long long b, c;
    a = A % B;
    d = D % B;
    if (d == 0) {
      c = C - a;
      b = B - a;
      if (b > 0 && c < 0) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    } else {
      c = (C - a) / d;
      b = (B - a) / d;
      if ((B - a) % d) {
        b++;
      }
      if (b - c > 1) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
  return 0;
}
