#include <bits/stdc++.h>
using namespace std;
long long szs[100001];
int main() {
  int n, k;
  long long ans = 0;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> szs[i];
  int db = n - k;
  long long mx = 0;
  for (int i = 1; i <= db; ++i) mx = max(szs[i] + szs[2 * db - i + 1], mx);
  mx = max(mx, szs[n]);
  cout << mx;
  return 0;
}
