#include <bits/stdc++.h>
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
using namespace std;
void jikken() {
  int la = 0, ra = 114;
  int tapi = 2;
  int b = 7 * tapi, c = 6 * tapi, d = 98 * tapi;
  for (int i = la; i < ra; ++i) {
    int tmp = i;
    while (tmp > c) tmp -= b;
    bool flag = true;
    for (int j = int(0); j < int(1000); j++) {
      if (tmp <= c) tmp += d;
      if (tmp < b) {
        flag = false;
        break;
      }
      tmp -= b;
    }
    if (flag) {
      cout << i << " : o" << endl;
    } else {
      cout << i << " : x" << endl;
    }
  }
}
bool cmp3(long long int a, long long int b, long long int c) {
  return a < b && b < c;
}
long long int gcd(long long int a, long long int b) {
  if (a < b) swap(a, b);
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int T;
  cin >> T;
  while (T--) {
    long long int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A < B) {
      cout << "No" << endl;
      continue;
    }
    if (A > C) {
      A -= (A - C) / B * B;
    }
    while (A > C) {
      A -= B;
    }
    if (A < 0) {
      cout << "No" << endl;
    } else if (D > B) {
      long long int g = gcd(B, D);
      long long int d = D - B;
      if (g <= B - 1 - C) {
        cout << "No" << endl;
      } else if (B - 1 - C <= 0) {
        cout << "Yes" << endl;
      } else if (C % g < B % g) {
        if (cmp3(C % g, A % g, B % g)) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      } else if (C % g > B % g) {
        if (cmp3(C % g - 1, A % g, B % g + g + 1)) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      } else {
        if (B % g == A % g) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      }
    } else if (D < B) {
      cout << "No" << endl;
    } else {
      if (cmp3(C, A, D)) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    }
  }
  return 0;
}
