#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; ++i) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    if (a < b || d < b) {
      cout << "No" << endl;
      continue;
    }
    if (c + 1 >= b) {
      cout << "Yes" << endl;
      continue;
    }
    long long arem;
    if (a > c) {
      if ((a - c) % b == 0) {
        arem = a - (((a - c) / b) * b);
        arem += b;
      } else {
        arem = a - (((a - c) / b) * b);
      }
    } else {
      arem = a;
    }
    set<long long> s;
    s.insert(arem);
    bool f = 0;
    for (int j = 0; j < 100000; ++j) {
      if (arem < b) {
        break;
      }
      if (s.count(arem) != 0 && j > 0) {
        f = 1;
        break;
      }
      arem = arem - b + d;
      if (arem > c) {
        if ((arem - c) % b == 0) {
          arem = arem - (((arem - c) / b) * b);
          arem += b;
        } else {
          arem = arem - (((arem - c) / b) * b);
        }
      }
    }
    if (f) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
