#include <bits/stdc++.h>
using namespace std;
long long W, H, N, ans, a, b, w, n, m, d;
long long A, B, C, D, T;
long long sub;
vector<int> v;
string s;
int main() {
  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 == D) {
      if (A % B > C) {
        cout << "No" << endl;
      } else {
        cout << "Yes" << endl;
      }
    } else {
      sub = D % B;
      if (sub == 0) {
        if (A % B > C) {
          cout << "No" << endl;
        } else {
          cout << "Yes" << endl;
        }
      } else if (B - C - 1 >= sub) {
        cout << "No" << endl;
      } else {
        long long tmp = A & B;
        long long num1;
        map<long long, bool> m;
        m[A % B] = true;
        if (B % sub == 0) {
          num1 = B / sub;
        } else {
          num1 = B / sub + 1;
        }
        long long num2;
        while (true) {
          num2 = tmp / sub;
          long long num = num1 - num2;
          for (long long i = num; true; i++) {
            if (tmp + sub * i >= B) {
              num = i;
              break;
            }
          }
          if (m[tmp + sub * num]) {
            cout << "Yes" << endl;
            break;
          }
          m[tmp + sub * num] = true;
          if (C < tmp + sub * (num - 1)) {
            cout << "No" << endl;
            break;
          }
          tmp = (tmp + sub * num) % B;
        }
      }
    }
  }
  cin >> ans;
  return 0;
}
