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