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