#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long mx = -1, i = n - 1;
  long long diff = n - k;
  long long on = n - 2 * diff;
  if (diff <= 0) {
    cout << *max_element(a, a + n);
    return 0;
  }
  while (on >= 1) {
    mx = max(mx, a[i--]);
    n = on--;
  }
  n = i;
  i = 0;
  long long j = n;
  while (i < j) {
    mx = max(mx, a[i++] + a[j--]);
  }
  cout << mx;
}
