#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const int MX = 2e5 + 5;
const string nl = "\n";
void fastscan(int &number) {
  bool negative = false;
  register int c;
  number = 0;
  c = getchar();
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;
  if (negative) number *= -1;
}
int modularPow(int x, unsigned int y, int p) {
  int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
bool prime(int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
vector<bool> sieve(int n) {
  vector<bool> prime(n + 1, true);
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  return prime;
}
int bsearch(int n, bool func(int)) {
  int x = -1;
  for (int b = n; b >= 1; b /= 2) {
    while (!func(x + b)) x += b;
  }
  return x + 1;
}
void input(string name) {
  ifstream fin(name + ".in");
  ofstream fout(name + ".out");
}
int arr[MX];
int n = MX;
int k = MX;
bool works(int x) {
  int targetEven = k / 2;
  int targetOdd = k - targetEven;
  int upper1 = (targetOdd == targetEven) ? n : (n + 1);
  int upper2 = (targetOdd == targetEven) ? (n + 1) : n;
  for (int i = 1; i < upper1; ++i) {
    if (arr[i] <= x) {
      targetOdd--;
      i++;
    }
  }
  if (targetOdd <= 0) return true;
  for (int i = 2; i < upper2; ++i) {
    if (arr[i] <= x) {
      targetEven--;
      i++;
    }
  }
  if (targetEven <= 0) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  set<int> elements;
  for (int i = 1; i < n + 1; ++i) {
    cin >> arr[i];
    elements.insert(arr[i]);
  }
  map<int, int> mapping;
  map<int, int> indices;
  int ind = 0;
  for (int val : elements) {
    ind++;
    mapping[val] = ind;
    indices[ind] = val;
  }
  for (int i = 1; i <= n; i++) {
    arr[i] = mapping[arr[i]];
  }
  cout << indices[bsearch(ind, works)] << nl;
}
