#include <bits/stdc++.h>
using namespace std;
long long a[100001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long rem = n, sz = -1;
  while (rem > 0 && 2 * k > rem) {
    sz = max(sz, a[rem - 1]);
    k--;
    rem--;
  }
  if (rem == 0) {
    cout << sz;
    return 0;
  }
  int lft = 0, rgt = rem - 1;
  while (lft <= rgt) {
    if (lft == rgt) {
      sz = max(sz, a[lft]);
      break;
    } else
      sz = max(sz, a[lft] + a[rgt]);
    lft++;
    rgt--;
  }
  cout << sz;
  return 0;
}
