#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  long long a, b, c, d;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> a >> b >> c >> d;
    if (a < b) {
      cout << "No" << endl;
      continue;
    }
    if (a - b < c) {
      if (d < b) {
        cout << "No" << endl;
        continue;
      }
      if (a - b + d - b < 0) {
        cout << "No" << endl;
        continue;
      }
      long long lo = 0, hi = 1000000000000000000, mid, ans = -1;
      while (lo <= hi) {
        mid = (lo + hi) / 2;
        long long pp = 1LL * mid * (d - b);
        if (a - b + pp <= c) {
          lo = mid + 1;
        } else if (a - b + pp >= b) {
          hi = mid - 1;
        } else if (a - b + pp > c && a - b + pp < b) {
          ans = mid;
          break;
        }
      }
      if (ans == -1) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
        continue;
      }
    } else {
      if (d < b) {
        cout << "No" << endl;
        continue;
      }
      long long lo = 0, hi = 100000000000000000, mid, ans = -1;
      while (lo <= hi) {
        mid = (lo + hi) / 2;
        long long pp = 1LL * mid * b;
        if (a - pp > c) {
          ans = mid;
          lo = mid + 1;
        } else if (a - pp <= c) {
          hi = mid - 1;
        }
      }
      if (ans == -1) {
        cout << "Yes" << endl;
        continue;
      }
      a = a - 1LL * ans * b;
      if (a >= b) {
        cout << "Yes" << endl;
      } else
        cout << "No" << endl;
    }
  }
  return 0;
}
