#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int T;
  cin >> T;
  string yes = "Yes";
  string no = "No";
  for (int t = 0; t < T; t++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (b > a) {
      cout << no << endl;
      continue;
    }
    if (b > d) {
      cout << no << endl;
      continue;
    }
    if (c >= b - 1) {
      if (d >= b) {
        cout << yes << endl;
        continue;
      }
    }
    bool flag = true;
    for (int i = c + 1; i < b; i++) {
      if (d % b == 1) {
        flag = false;
        break;
      }
      if (d % b == 0) {
        if (i - a % b == 0) {
          flag = false;
          break;
        } else {
          continue;
        }
      }
      if (gcd(i - a % b, d % b) != 1) {
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << yes << endl;
    } else {
      cout << no << endl;
    }
  }
}
