#include <bits/stdc++.h>
using namespace std;
long long amari(long long a, long long b, long long c) {
  long long ub = 0, lb = a / b, mid;
  while (lb - ub > 1) {
    mid = (lb + ub) / 2;
    if (a - mid * b > c) {
      ub = mid;
    } else {
      lb = mid;
    }
  }
  return a - lb * b;
}
int main() {
  long long i, j, t, a, b, c, d, e;
  cin >> t;
  for (i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (d < b || a < b || a % b > c) {
      cout << "No" << endl;
      continue;
    }
    if (d % b == 0) {
      cout << "Yes" << endl;
      continue;
    }
    e = a;
    for (j = 0; j < 1000000; j++) {
      a = amari(a, b, c);
      if (a <= c) {
        a = a + d;
      }
      if (a == e) {
        cout << "Yes" << endl;
        break;
      }
      if (a < b) {
        cout << "No" << endl;
        break;
      }
    }
  }
}
