#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int a = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) a = (a << 3) + (a << 1) + ch - '0';
  return a * f;
}
const int mod = 1e9 + 7;
const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
const int INF = 2147483647;
const double PI = acos(-1);
int a[N], n, k, l = 1, r, ans;
inline bool check(int p) {
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (cnt & 1) {
      if (a[i] <= p) cnt++;
    } else
      cnt++;
  }
  if (cnt >= k) return true;
  cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (!(cnt & 1)) {
      if (a[i] <= p) cnt++;
    } else
      cnt++;
  }
  if (cnt >= k) return true;
  return false;
}
signed main() {
  n = read();
  k = read();
  for (int i = 1; i <= n; i++) r = max(r, a[i] = read());
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      r = mid - 1, ans = mid;
    else
      l = mid + 1;
  }
  printf("%d\n", ans);
  return 0;
}
