#include <bits/stdc++.h>
using namespace std;
int main() {
  int gcd(long long int, long long int);
  long long int t, a, b, c, d, j;
  long long int num, amari;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (a < b)
      cout << "No" << endl;
    else if (b > d)
      cout << "No" << endl;
    else if (b < c)
      cout << "Yes" << endl;
    else if (b == d && a % b > c)
      cout << "No" << endl;
    else if (b == d && a % d <= c)
      cout << "Yes" << endl;
    else {
      num = gcd(b, d);
      if (b - num > c)
        cout << "No" << endl;
      else {
        amari = a % b;
        for (j = 0; j <= b / num; j++) {
          if (b > amari + j * num && amari + j * num > c)
            cout << "No" << endl;
          else if (j == b / num)
            cout << "Yes" << endl;
        }
      }
    }
  }
  return 0;
}
int gcd(long long int x, long long int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
