#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const long long INF64 = 1LL * INF * INF;
const long long mod = INF + 7;
const long double eps = 1e-9;
int kk[100001];
void solve() {
  int n, k;
  cin >> n >> k;
  if (k > n) k = n;
  int del = n - k;
  for (int i = 0; i < n; ++i) {
    cin >> kk[i];
  }
  int sz = kk[n - 1];
  for (int i = 0; i < del; ++i) {
    sz = max(sz, kk[del - i - 1] + kk[del + i]);
  }
  cout << sz << endl;
}
int main() {
  cout.sync_with_stdio(false);
  solve();
  return 0;
}
