#include <bits/stdc++.h>
using namespace std;
vector<long long int> A;
int n, k;
bool good(long long int bound) {
  vector<long long int> B;
  int cntr = 0;
  for (long long int x : A) {
    if (cntr % 2 == 0) {
      B.push_back(x);
      cntr++;
    } else {
      if (x <= bound) {
        B.push_back(x);
        cntr++;
      }
    }
  }
  if (B.size() >= k) {
    return true;
  } else {
    return false;
  }
}
bool good2(long long int bound) {
  vector<long long int> B;
  int cntr = 0;
  for (long long int x : A) {
    if (cntr % 2 == 1) {
      B.push_back(x);
      cntr++;
    } else {
      if (x <= bound) {
        B.push_back(x);
        cntr++;
      }
    }
  }
  if (B.size() >= k) {
    return true;
  } else {
    return false;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  A.resize(n);
  long long int maximum = 0;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    maximum = max(maximum, A[i]);
  }
  long long int a = 0;
  long long int b = maximum;
  while (a + 1 < b) {
    long long int m = (a + b) / 2;
    if (good(m)) {
      b = m;
    } else {
      a = m;
    }
  }
  long long int act = b;
  a = 0;
  b = maximum;
  while (a + 1 < b) {
    long long int m = (a + b) / 2;
    if (good2(m)) {
      b = m;
    } else {
      a = m;
    }
  }
  cout << min(b, act);
  return 0;
}
