#include <bits/stdc++.h>
using namespace std;
struct UnionFind {
  vector<int> par;
  UnionFind(int n) : par(n, -1) {}
  void init(int n) { par.assign(n, -1); }
  int root(int x) {
    if (par[x] < 0)
      return x;
    else
      return par[x] = root(par[x]);
  }
  bool issame(int x, int y) { return root(x) == root(y); }
  bool merge(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (par[x] > par[y]) swap(x, y);
    par[x] += par[y];
    par[y] = x;
    return true;
  }
  int size(int x) { return -par[root(x)]; }
};
int gcd(int a, int b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b || c < a % b) {
      cout << "No" << endl;
    } else {
      if (c >= b) {
        cout << "Yes" << endl;
      } else if (d % b == 0)
        cout << "Yes" << endl;
      else {
        long long x = a % b + (((b - (a % b)) / (d % b)) * (d % b));
        if (x == b) x -= d % b;
        if (c < x)
          cout << "No" << endl;
        else {
          cout << "Yes" << endl;
        }
      }
    }
  }
}
