#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, k, l;
    cin >> n >> k >> l;
    int d[n];
    for (auto &i : d) cin >> i;
    int m = 0, c = k;
    bool f = true, g = true;
    for (int i = 0; i < n; i++) {
      if (d[i] > l) {
        f = false;
        break;
      }
      if (d[i] <= l - k)
        c = l - (i == n - 1 ? 0 : d[i + 1]), g = (bool)c;
      else {
        if (c + d[i] > l)
          if (!g) {
            f = false;
            break;
          } else
            c = l - d[i], g = (bool)c;
        if (g)
          c--;
        else
          c++;
        if (c == 0) g = false;
      }
    }
    f ? cout << "YES\n" : cout << "NO\n";
  }
}
