#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, k, s[100011];
  cin >> n >> k;
  for (long int i = 0; i < n; i++) cin >> s[i];
  long int a = n - k - 1, b = n - k, mn, mx = s[n - 1];
  while (a >= 0) {
    mn = s[a] + s[b];
    a--;
    b++;
    if (mn > mx) mx = mn;
  }
  cout << mx;
  return 0;
}
