#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef pair pii; typedef pair pll; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define DEBUG(x) cout<<#x<<": "< P; int n,m; int a[125252]; int my; bool ok(int you){ int we = my + a[you]; multiset S; REP(i,n)if(i!=you)S.insert(a[i]); REP(i,m){ auto it = S.end();it--; int mx = *it;S.erase(it); int rest = we - mx + 1; it = S.lower_bound(rest); if(it == S.end())return true; else{ S.erase(it); } } return false; } int main(){ scanf("%d%d",&n,&m); REP(i,n)scanf("%d",a+i); my = a[0]; a[0] = a[n-1]; n--; sort(a,a+n); if(m-1 == n/2){ cout<