#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void chkmin(T1 &x, T2 y) {
  if (x > y) x = y;
}
template <typename T1, typename T2>
inline void chkmax(T1 &x, T2 y) {
  if (x < y) x = y;
}
template <typename T, typename U>
inline ostream &operator<<(ostream &_out, const pair<T, U> &_p) {
  _out << _p.first << ' ' << _p.second;
  return _out;
}
template <typename T, typename U>
inline istream &operator>>(istream &_in, pair<T, U> &_p) {
  _in >> _p.first >> _p.second;
  return _in;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const vector<T> &_v) {
  if (_v.empty()) {
    return _out;
  }
  _out << _v.front();
  for (auto _it = ++_v.begin(); _it != _v.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline istream &operator>>(istream &_in, vector<T> &_v) {
  for (auto &_i : _v) {
    _in >> _i;
  }
  return _in;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const set<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const multiset<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const unordered_set<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const unordered_multiset<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T, typename U>
inline ostream &operator<<(ostream &_out, const map<T, U> &_m) {
  if (_m.empty()) {
    return _out;
  }
  _out << '(' << _m.begin()->first << ": " << _m.begin()->second << ')';
  for (auto _it = ++_m.begin(); _it != _m.end(); ++_it) {
    _out << ", (" << _it->first << ": " << _it->second << ')';
  }
  return _out;
}
template <typename T, typename U>
inline ostream &operator<<(ostream &_out, const unordered_map<T, U> &_m) {
  if (_m.empty()) {
    return _out;
  }
  _out << '(' << _m.begin()->first << ": " << _m.begin()->second << ')';
  for (auto _it = ++_m.begin(); _it != _m.end(); ++_it) {
    _out << ", (" << _it->first << ": " << _it->second << ')';
  }
  return _out;
}
const string FILENAME = "input";
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
int t;
long long a, b, c, d;
bool can(long long st, long long jump, long long l, long long r,
         long long mod) {
  st %= mod;
  l -= st;
  r -= st;
  l %= mod;
  r %= mod;
  vector<pair<long long, long long> > add;
  if (l < 0 && r < 0) {
    l += mod;
    r += mod;
    add.push_back({l, r});
  } else {
    if (l < 0) {
      l += mod;
      add.push_back({l, mod - 1});
      add.push_back({0, r});
    } else {
      add.push_back({l, r});
    }
  }
  jump %= mod;
  if (jump == 0) {
    for (auto x : add) {
      if (x.first <= 0 && 0 <= x.second) {
        return true;
      }
    }
    return false;
  }
  long long f = gcd(jump, mod);
  for (auto x : add) {
    x.first %= f;
    x.second %= f;
    if (x.first > x.second || x.first == 0 || x.second == 0) {
      return true;
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  freopen((FILENAME + ".in").c_str(), "r", stdin);
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No\n";
      continue;
    }
    if (b > d) {
      cout << "No\n";
      continue;
    }
    long long t = (a - c - 1) / b;
    a -= (t + 1) * b;
    if (a + d < b) {
      cout << "No\n";
      continue;
    }
    if (c + 1 < b) {
      if (can(a, d, c + 1, b - 1, b)) {
        cout << "No\n";
        continue;
      }
    }
    if (b - d > 0 && b - d <= c) {
      if (can(a, d, 0, b - d - 1, b)) {
        cout << "No\n";
        continue;
      }
    }
    bool bad = false;
    long long pa = a;
    for (int it = 0; it < 1000; it++) {
      a += d;
      if (a < b) {
        bad = true;
        break;
      }
      long long t = (a - c - 1) / b;
      a -= (t + 1) * b;
    }
    if (bad) {
      cout << "No\n";
      continue;
    }
    cout << "Yes\n";
  }
}
