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