#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = (0); i < (t); ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No" << endl;
      continue;
    }
    if (b <= c) {
      cout << "Yes" << endl;
      continue;
    }
    if (b == 1) {
      cout << "Yes" << endl;
      continue;
    }
    if (d % b == 0 && a % b > c) {
      cout << "No" << endl;
      continue;
    } else if (d % b == 0) {
      cout << "Yes" << endl;
      continue;
    }
    d = d % b;
    bool flag = true;
    for (int i = (0); i < (2800000); ++i) {
      a = a % b;
      if (a > c) {
        flag = false;
        break;
      }
      a += d;
    }
    if (flag) {
      cout << "Yes" << endl;
      continue;
    } else {
      cout << "No" << endl;
      continue;
    }
  }
  return 0;
}
