#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
int main() {
  int t;
  cin >> t;
  for (int i = (0); i < (t); ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > d) {
      cout << "No" << endl;
      continue;
    }
    if (b > a) {
      cout << "No" << endl;
      continue;
    }
    if (b == d) {
      if (a % b > c) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
      continue;
    }
    int flag = 0;
    for (int i = (0); i < (100000); ++i) {
      a = a % b;
      if (a > c) {
        cout << "No" << endl;
        flag = 1;
        break;
      } else
        a += d;
    }
    if (!flag) cout << "Yes" << endl;
  }
  return 0;
}
