#include <bits/stdc++.h>
using namespace std;
long long calc(long long a, long long b, long long mod, long long border,
               int bad) {
  if (mod == 0 || border >= mod) return 0;
  if (mod <= 100 || b == 0) {
    map<long long, long long> input;
    long long now = a;
    while (input[now] == 0) {
      input[now]++;
      if (now > border && (bad == 0 || now != mod - 1)) return 1;
      now += b;
      now %= mod;
    }
    return 0;
  }
  a += (mod - a) / b * b;
  if (a >= mod) a -= b;
  a %= mod;
  if (a > border && (bad == 0 || a != mod - 1)) return 1;
  if (a > b) {
    a += b;
  }
  a %= mod;
  a %= b;
  long long now = a;
  a += (mod - a) / b * b;
  if (a >= mod) a -= b;
  a %= mod;
  if (a > border && (bad == 0 || a != mod - 1)) return 1;
  if (a >= b) {
    a += b;
  }
  a %= mod;
  a %= b;
  long long geko = a - now + b;
  geko %= b;
  return calc(a % b, geko % b, b, border % b, 1);
}
int main() {
  long long test_case;
  cin >> test_case;
  for (long long hoge = 0; hoge < test_case; ++hoge) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || b > d) {
      cout << "No" << endl;
      continue;
    }
    a %= b;
    d %= b;
    string hogea[2] = {"Yes", "No"};
    cout << hogea[calc(a, d, b, c, 0)] << endl;
    ;
  }
  return 0;
}
