#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int N, K;
  cin >> N >> K;
  vector<int> V(N);
  for (int i = 0; i < N; ++i) cin >> V[i];
  if (K >= N) {
    cout << *max_element(V.begin(), V.end());
    return 0;
  }
  int alones = (2 * K) - N, best = 0;
  for (int i = 1; i <= alones; ++i) best = max(best, V[N - i]);
  for (int i = 0, j = N - alones - 1; i < K - alones; i++, j--)
    best = max(best, V[i] + V[j]);
  cout << best;
  return 0;
}
