#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 || d % b == 0) {
        cout << "Yes" << endl;
      } else {
        unsigned long long int inc = d % b;
        unsigned long long int high = b - 1, low = c + 1;
        map<unsigned long long int, bool> m;
        while (true) {
          unsigned long long int many = (c - a) / inc;
          unsigned long long int check = inc * (many + 1) + a;
          if (check == b) check -= inc;
          if (low <= check && check <= high) {
            cout << "No" << endl;
            break;
          } else if (m[check]) {
            cout << "Yes" << endl;
            break;
          }
          m[check]++;
          if (check == b - inc) check = b;
          a = check + d;
          a %= b;
        }
      }
    }
  }
  return 0;
}
