#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using G = vector<vector<int>>;
int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
LL gcd(LL x, LL y) { return y ? gcd(y, x % y) : x; }
bool solve(LL a, LL b, LL c, LL d) {
  if (a < b) {
    return false;
  } else {
    if (d < b) {
      return false;
    } else {
      if (c < b) {
        if (gcd(b, d) == 1) {
          if (b - c > 1) {
            return false;
          } else {
            return true;
          }
        } else {
          a -= (a - b) / b * b;
          LL diff = d - b;
          if (diff == 0) {
            if (a - d > c && a - d < b) {
              return false;
            } else {
              return true;
            }
          } else {
            if (b - c > 1) {
              if ((b - c) <= diff) {
                if ((c - (a - d) + 1) % diff >= (b - (a - d) - 1) % diff) {
                  return true;
                } else {
                  return false;
                }
              } else {
                return false;
              }
            } else {
              return true;
            }
          }
        }
      } else {
        return true;
      }
    }
  }
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  for (int i = (0); i < (t); i++) {
    LL a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << (solve(a, b, c, d) ? "Yes" : "No") << endl;
  }
  return 0;
}
