#include <bits/stdc++.h>
using namespace std;
using long long int = long long int;
using pii = pair<int, int>;
using pll = pair<long long int, long long int>;
using vi = vector<int>;
using vl = vector<long long int>;
using vii = vector<pii>;
using vll = vector<pll>;
long long int gcd(long long int a, long long int b) {
  if (a < b) swap(a, b);
  long long int tmp;
  while (b) {
    tmp = b;
    b = a % b;
    a = tmp;
  }
  return a;
}
int main() {
  int N;
  scanf("%d", &N);
  long long int a, b, c, d;
  bool ans;
  while (N--) {
    ans = true;
    scanf("%lld%lld", &a, &b);
    scanf("%lld%lld", &c, &d);
    if (a < b) ans = false;
    if (d < b) ans = false;
    if (c >= b - 1) {
    } else {
      long long int dan = b - c;
      long long int inc = d % b;
      long long int bac = inc == 0 ? 0 : b % inc;
      long long int mov = gcd(inc, bac);
      if (mov == 0) {
        long long int dis = (a % b);
        if (b - dis < dan) ans = false;
      } else {
        long long int dis = (a % b) % mov;
        if (mov < dan)
          ans = false;
        else {
          long long int ex = dis + b - mov;
          if (ex < b - dan) ans = false;
        }
      }
    }
    (ans) ? printf("Yes\n") : printf("No\n");
  }
  return 0;
}
