#include <bits/stdc++.h>
using namespace std;
typedef struct data {
  int now;
  int cost;
} data;
int nw[9] = {0, 1, 0, -1, -1, 1, 1, -1, 0};
int nh[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
int main() {
  unsigned long long int a, b, c, d;
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (b > d || a < b) {
      cout << "No" << endl;
    } else if (b < c) {
      cout << "Yes" << endl;
    } else {
      a %= b;
      if (a > c) {
        cout << "No" << endl;
      } else if (b == d) {
        cout << "Yes" << endl;
      } else {
        unsigned long long int inc = d - b;
        unsigned long long int high = b - 1, low = c + 1;
        map<int, bool> m;
        while (true) {
          a += d;
          unsigned long long int many = (a - c) / b;
          a -= (many)*b;
          if (a >= b) a -= b;
          if (low <= a && a <= high) {
            cout << "No" << endl;
            break;
          }
          if (m[a]) {
            cout << "Yes" << endl;
            break;
          }
          m[a]++;
        }
      }
    }
  }
  return 0;
}
