#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC target("avx2")
using namespace std;
const int mod = 998244353;
const int inf = 1000000007;
const int mxn = 4e5 + 7;
long long _, m, n, t, k, ans;
int a[mxn], b[mxn];
int check(int x) {
  long long cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (cnt & 1) {
      if (a[i] <= x) cnt++;
    } else
      cnt++;
  }
  if (cnt >= m) return 1;
  cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (cnt % 2 == 0) {
      if (a[i] <= x) cnt++;
    } else
      cnt++;
  }
  if (cnt >= m) return 1;
  return 0;
}
void solve() {
  while (cin >> n >> m) {
    for (int i = 1; i <= n; i++) cin >> a[i], b[i] = a[i], a[i + n] = a[i];
    sort(b + 1, b + 1 + n);
    int l = -1, r = inf;
    while (l < r) {
      int mid = (l + r) >> 1;
      if (check(mid) == 1)
        r = mid;
      else
        l = mid + 1;
    }
    cout << l << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
