#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d, t;
  long long aa[1100], bb[1100], cc[1100], dd[1100];
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> aa[i] >> bb[i] >> cc[i] >> dd[i];
  }
  for (int i = 0; i < t; i++) {
    a = aa[i];
    b = bb[i];
    c = cc[i];
    d = dd[i];
    if (a < b) {
      cout << "No" << endl;
      goto end;
    }
    if (b > d) {
      cout << "No" << endl;
      goto end;
    } else if (b == d) {
      if (a % b <= c)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
      goto end;
    } else {
      if (a % b > c) {
        cout << "No" << endl;
        goto end;
      } else {
        if (c + 1 >= b) {
          cout << "Yes" << endl;
        } else {
          int le = c + 1 - a % b;
          int ri = b - 1 - a % b;
          int st = d - b;
          if ((ri / st) * st >= le) {
            cout << "No" << endl;
          } else {
            cout << "Yes" << endl;
          }
        }
        goto end;
      }
    }
  end:
    a = a + 0;
  }
  return 0;
}
