#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int tc;
  cin >> tc;
  while (tc--) {
    int a, b, c;
    cin >> a >> b >> c;
    vector<int> v(a);
    bool can = true;
    for (int i = 0; i < a; i++) {
      cin >> v[i];
      if (v[i] + b <= c) {
        v[i] = 1e9;
      } else if (v[i] > c) {
        can = false;
      } else {
        v[i] = c - v[i];
      }
    }
    if (!can) {
      cout << "NO" << endl;
      continue;
    }
    int time = -1e9;
    for (int i = 0; i < a; i++) {
      if (v[i] == 1e9) {
        time = -1e9;
        continue;
      }
      if (time > v[i]) {
        can = false;
        break;
      }
      time = max(time, -v[i]);
      time += 1;
    }
    if (can) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
