#include <bits/stdc++.h>
const int N = 100005;
using namespace std;
int main() {
  int data;
  long long a, b, c, d;
  cin >> data;
  while (data--) {
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      puts("No");
      continue;
    }
    if (a < c) {
      puts("Yes");
      continue;
    }
    long long x = (a - c) / b;
    x *= b;
    a -= x;
    if (a == c) a += b;
    if (a < b) {
      puts("No");
      continue;
    }
    long long e = d - b;
    a -= b;
    c++;
    if (d == b) {
      puts("Yes");
      continue;
    }
    x = (c - a) / e;
    x *= e, a += x;
    while (a < c) a += e;
    if (a < b)
      puts("No");
    else
      puts("Yes");
  }
  return 0;
}
