#include <bits/stdc++.h>
using namespace std;
long long n, k, i, s[100005], t, ans;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  for (i = 0; i < n; ++i) cin >> s[i];
  ans = s[n - 1];
  t = min(n - 1, 2 * (n - k) - 1);
  for (i = 0; i <= t; ++i) ans = max(ans, s[i] + s[t - i]);
  cout << ans;
  return 0;
}
