#include <iostream>
#include <vector>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, j, k;
cin >> n >> j >> k;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
// Player j has 0-indexed position j-1
int player_j_strength = a[j-1];
// Alternative approach: Player j can survive if they're not among the weakest n-k players
// Count how many players are strictly weaker than player j
int weaker_players = 0;
for (int i = 0; i < n; i++) {
if (a[i] < player_j_strength) {
weaker_players++;
}
}
// Player j can survive if there are at least n-k players weaker than j
// This means j is not among the n-k weakest players
if (weaker_players >= n - k) {
cout << "YES\n";
} else {
cout << "NO\n";
}
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICBpbnQgdDsKICAgIGNpbiA+PiB0OwogICAgCiAgICB3aGlsZSAodC0tKSB7CiAgICAgICAgaW50IG4sIGosIGs7CiAgICAgICAgY2luID4+IG4gPj4gaiA+PiBrOwogICAgICAgIAogICAgICAgIHZlY3RvcjxpbnQ+IGEobik7CiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgY2luID4+IGFbaV07CiAgICAgICAgfQogICAgICAgIAogICAgICAgIC8vIFBsYXllciBqIGhhcyAwLWluZGV4ZWQgcG9zaXRpb24gai0xCiAgICAgICAgaW50IHBsYXllcl9qX3N0cmVuZ3RoID0gYVtqLTFdOwogICAgICAgIAogICAgICAgIC8vIEFsdGVybmF0aXZlIGFwcHJvYWNoOiBQbGF5ZXIgaiBjYW4gc3Vydml2ZSBpZiB0aGV5J3JlIG5vdCBhbW9uZyB0aGUgd2Vha2VzdCBuLWsgcGxheWVycwogICAgICAgIC8vIENvdW50IGhvdyBtYW55IHBsYXllcnMgYXJlIHN0cmljdGx5IHdlYWtlciB0aGFuIHBsYXllciBqCiAgICAgICAgaW50IHdlYWtlcl9wbGF5ZXJzID0gMDsKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewogICAgICAgICAgICBpZiAoYVtpXSA8IHBsYXllcl9qX3N0cmVuZ3RoKSB7CiAgICAgICAgICAgICAgICB3ZWFrZXJfcGxheWVycysrOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIAogICAgICAgIC8vIFBsYXllciBqIGNhbiBzdXJ2aXZlIGlmIHRoZXJlIGFyZSBhdCBsZWFzdCBuLWsgcGxheWVycyB3ZWFrZXIgdGhhbiBqCiAgICAgICAgLy8gVGhpcyBtZWFucyBqIGlzIG5vdCBhbW9uZyB0aGUgbi1rIHdlYWtlc3QgcGxheWVycwogICAgICAgIGlmICh3ZWFrZXJfcGxheWVycyA+PSBuIC0gaykgewogICAgICAgICAgICBjb3V0IDw8ICJZRVNcbiI7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgY291dCA8PCAiTk9cbiI7CiAgICAgICAgfQogICAgfQogICAgCiAgICByZXR1cm4gMDsKfQ==