#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
long long int n;
int main() {
  int t;
  cin >> t;
  long long int a, b, c, d;
  while (t--) {
    map<long long int, long long int> m;
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << '\n';
      continue;
    }
    if (d < b) {
      cout << "No" << '\n';
      continue;
    }
    if (a % b > c) {
      cout << "No" << '\n';
      continue;
    }
    if (c >= b) {
      cout << "Yes" << '\n';
      continue;
    }
    int g = 0;
    while (1) {
      a = a % b;
      if (a > c) {
        cout << "No" << '\n';
        g = 1;
        break;
      }
      a += d;
      if (m[a]) {
        break;
      }
      m[a] = 1;
    }
    if (g == 0) {
      cout << "Yes" << '\n';
    }
  }
  return 0;
}
