#include <bits/stdc++.h>
using namespace std;
const int INF = (int)2e9 + 9;
const int SIZE = (int)2e5 + 5;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n, k, l, flag = 0;
    cin >> n >> k >> l;
    int d[n];
    for (int i = 0; i < n; i += 1) {
      cin >> d[i];
    }
    int p1, p2;
    p1 = k;
    p2 = -k + 1;
    for (int i = 0; i < n; i++) {
      int x = l - d[i];
      if (x < 0) {
        flag -= 1;
        break;
      }
      if (x >= k) {
        p1 = k;
        p2 = -k + 1;
        continue;
      }
      if (p1 * p2 < 0) {
        if (p1 < p2) {
          swap(p1, p2);
        }
        p1 = x;
        p2 = -min(x, -p2);
      } else if (p1 * p2 > 0) {
        if (p1 > 0) {
          if (p1 > p2) {
            swap(p1, p2);
          }
          if (p1 > x) {
            flag = -1;
            break;
          }
          p2 = x;
        } else {
          if (p1 < p2) {
            swap(p1, p2);
          }
          if (-p1 > x) {
            flag = -1;
            break;
          }
          p1 = x;
        }
      } else {
        if (p2 == 0) {
          swap(p1, p2);
        }
        if (p2 > 0) {
          p2 = x;
        } else if (p2 < 0) {
          p1 = x;
        } else {
          p1 = x;
        }
      }
      p1++;
      p2++;
    }
    if (flag == -1) {
      cout << "No";
    } else {
      cout << "Yes";
    }
    cout << "\n";
  }
}
