#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    bool flag = true;
    a = a - b;
    if (a < 0) {
      flag = false;
    } else {
      if (a > c) {
        long long tx = ceil((a - c + 0.0) / b);
        a = a - tx * b;
        if (a < 0) flag = false;
      }
      long long td = d - b;
      if (!flag || !td) {
        ;
      } else if (td < 0) {
        flag = false;
      } else {
        if (1) {
          set<int> poss;
          poss.insert(a);
          int count = 33000;
          long long ty;
          while (count--) {
            ty = ceil((c - a + 1.0) / td);
            a = a + ty * td;
            long long tx = ceil((a - c + 0.0) / b);
            a = a - tx * b;
            if (a < 0 || tx == 0) {
              flag = false;
              count = 0;
            } else {
              if (poss.find(a) != poss.end()) {
                flag = true;
                count = 0;
                break;
              }
              poss.insert(a);
            }
          }
        }
      }
    }
    flag ? cout << "Yes\n" : cout << "No\n";
  }
}
