#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int T;
long long a, b, c, d;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);
    if (a < b || d < b) {
      puts("No");
    } else if (a % b > c) {
      puts("No");
    } else if (c >= b) {
      puts("Yes");
    } else {
      long long dd = d % b, p = d - b;
      if (p == 0) {
        puts("Yes");
        continue;
      }
      a = a % b;
      long long t = (c - a) / p + 1;
      long long f = a + t * p;
      f = f - (f - c - 1) / b * b;
      if (b < c) {
        puts("Yes");
      }
      if (f < b) {
        puts("No");
      } else {
        long long h = f - b;
        bool flag = true;
        while (h != f - b) {
          t = (c - h) / p + 1;
          h = h + t * dd;
          h = h - (h - c) / b * b;
          if (h < b) {
            puts("No");
            flag = false;
            break;
          }
          h -= b;
        }
        if (flag) puts("Yes");
      }
    }
  }
}
