#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long int a, b, c, d;
  long long int i = 0;
  long long int sa;
  long long int tmp;
  vector<long long int> v;
  cin >> n;
  for (i = 0; i < n; i++) {
    v.clear();
    cin >> a >> b >> c >> d;
    sa = d - b;
    a -= b * ((a - c) / b);
    if (sa < 0) {
      cout << "No" << endl;
    } else if (sa == 0) {
      if (b <= c) {
        cout << "Yes" << endl;
      } else {
        tmp = a;
        while (tmp > c) {
          v.push_back(tmp);
          tmp -= b;
        }
        a = *min_element(v.begin(), v.end());
        if (c <= a && a <= b - 1) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      }
    } else {
      if (b <= c) {
        cout << "Yes" << endl;
      } else if (b - c == 1) {
        cout << "Yes" << endl;
      } else {
        tmp = a;
        tmp -= b;
        while (tmp < c) {
          tmp += d;
          tmp -= b;
        }
        a = tmp;
      }
      if (c <= a && a <= b - 1) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
}
