#include <bits/stdc++.h>
using namespace std;
long long multiply(long long num1, long long num2, long long mod) {
  long long ans = 0;
  num1 %= mod;
  num2 %= mod;
  while (num2) {
    if (num2 & 1) {
      ans += num1;
      ans %= mod;
    }
    num1 *= 2;
    num1 %= mod;
    num2 /= 2;
  }
  return ans;
}
long long powmod2(long long base, long long exponent, long long mod) {
  long long ans = 1;
  while (exponent) {
    if (exponent & 1) {
      ans = multiply(ans, base, mod);
    }
    base = multiply(base, base, mod);
    exponent /= 2;
  }
  return ans;
}
long long powmod(long long base, long long exponent, long long mod) {
  long long ans = 1;
  while (exponent) {
    if (exponent & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    exponent /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
const int upperlimit = 1e6 + 100;
const int mod = 1e9 + 7;
int arr[upperlimit];
int main() {
  int t;
  long long a, b, c, d;
  scanf("%d", &t);
  while (t--) {
    bool check = 1;
    scanf("%lld", &a);
    scanf("%lld", &b);
    scanf("%lld", &c);
    scanf("%lld", &d);
    for (int i = 1; i <= 2000; i++) {
      if (a < b) {
        check = 0;
        break;
      }
      if (a > c) {
        a -= c;
        a--;
        a %= b;
        a++;
        a += c;
      }
      a -= b;
      if (a < 0) {
        check = 0;
        break;
      }
      if (a <= c) {
        a += d;
      }
    }
    if (check) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
