#include <bits/stdc++.h>
using namespace std;
int s[100000];
int main() {
  int n, k, ans;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  ans = s[n - 1];
  int single = k * 2 - n;
  int paired = n - single;
  for (int i = 0; i < paired / 2; i++) {
    ans = max(ans, s[i] + s[n - single - 1 - i]);
  }
  cout << ans << endl;
}
