#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, A;
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> a >> b >> c >> d;
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (c >= b) {
      cout << "Yes" << endl;
      continue;
    }
    if (a - d == c) {
      cout << "Yes" << endl;
      continue;
    }
    a -= (a / b - c / b - 1) * b;
    A = a;
    while (1) {
      a -= b;
      if (a < 0) {
        cout << "No" << endl;
        break;
      }
      if (a <= c) a += d;
      if (a == A) {
        cout << "Yes" << endl;
        break;
      }
    }
  }
}
