#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;
const long long int MOD = 1e9 + 696969;
const long long INF = 1e18 + 3;
int t;
bool fails(long long int pos, long long int c) {
  if (pos > c) return 1;
  return 0;
}
long long int mygcd(long long int a, long long int b) {
  while (a > 0 && b > 0) {
    if (a > b)
      a = a % b;
    else
      b = b % a;
  }
  return a + b;
}
bool solve() {
  long long int a, b, c, d;
  cin >> a >> b >> c >> d;
  if (b > d) return 0;
  if (b > a) return 0;
  if (b <= c) return 1;
  if (fails(a % b, c)) return 0;
  if (d % b == 0) return 1;
  long long int p = mygcd(b, d);
  long long int reszta = (a % p);
  if (reszta == 0) reszta = p;
  if (fails((b - reszta) % b, c)) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    if (solve())
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
