#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  int a[n + 1];
  int i, j;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long int res = 0;
  for (i = 1; i <= n; i++) {
    res = max(res, (long long int)a[i]);
  }
  long long int ans = 0;
  if (k >= n) {
    ans = res;
  } else {
    long long int count = 0;
    count = 2 * k - n;
    count = n - count;
    for (i = 1; i <= count; i++) {
      res = max(res, (long long int)a[i] + a[count - i + 1]);
    }
    ans = res;
  }
  cout << ans << endl;
}
