#include <bits/stdc++.h>
using namespace std;
const long long int maxN = 200005;
vector<long long int> arr(maxN);
long long int n, k, ans;
bool sortbysec(const pair<long long int, long long int> &a,
               const pair<long long int, long long int> &b) {
  return (a.second < b.second);
}
bool isValidEven(long long int m) {
  long long int cc = 0;
  for (long long int i = 0; i < n; i++) {
    if (cc % 2 == 0)
      cc++;
    else if (arr[i] <= m)
      cc++;
  }
  return cc >= k;
}
bool isValidOdd(long long int m) {
  long long int cc = 0;
  for (long long int i = 0; i < n; i++) {
    if (cc % 2 == 1)
      cc++;
    else if (arr[i] <= m)
      cc++;
  }
  return cc >= k;
}
long long int search(long long int f, long long int l) {
  long long int ans = l;
  while (f <= l) {
    long long int mid = (f + l) / 2;
    if (isValidOdd(mid) || isValidEven(mid)) {
      ans = mid;
      l = mid - 1;
    } else
      f = mid + 1;
  }
  return ans;
}
int32_t main() {
  long long int t = 1;
  while (t--) {
    cin >> n >> k;
    for (long long int i = 0; i < n; i++) cin >> arr[i];
    cout << search(1, 1e9);
  }
}
