#include <bits/stdc++.h>
using namespace std;
const long long int MAX_N = 1e5 + 5;
const long long int MOD = 1e9 + 7;
const long long int INF = 1e9;
long long int a[200001];
long long int n, k;
bool isPossibleEven(long long int val) {
  long long int sum = 0;
  for (long long int i = 1; i < n + 1; i++) {
    if (!(sum & 1)) {
      sum++;
    } else {
      if (a[i] <= val) {
        sum++;
      }
    }
  }
  return sum >= k;
}
bool isPossibleOdd(long long int val) {
  long long int sum = 0;
  for (long long int i = 1; i < n + 1; i++) {
    if (!(sum & 1)) {
      if (a[i] <= val) {
        sum++;
      }
    } else {
      sum++;
    }
  }
  return sum >= k;
}
long long int ok(long long int l, long long int h) {
  long long int ans = h;
  while (l <= h) {
    long long int mid = (l + h) / 2;
    if (isPossibleOdd(mid) || isPossibleEven(mid))
      ans = mid, h = mid - 1;
    else
      l = mid + 1;
  }
  return ans;
}
void solve() {
  cin >> n >> k;
  for (long long int i = 1; i < n + 1; i++) cin >> a[i];
  cout << ok(1, 1e9);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(10);
  cout << fixed;
  long long int t = 1;
  for (long long int i = 1; i <= t; i++) {
    solve();
  }
}
