#include <bits/stdc++.h>
using namespace std;
map<long long, long long> a, C, A;
int main() {
  long long n, k, c = -1, C = 0, g = 0;
  cin >> n >> k;
  long long a[n], N = n - 1, m = n, K = k;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (k == 1) c = a[0] + a[1];
  if (n == 1) c = a[0];
  if (k >= n) {
    cout << a[n - 1] << endl;
    return 0;
  }
  for (int i = 0, f = 0; i < N;) {
    if (m > K) {
      C = a[i] + a[i + 1];
      g++;
      c = max(c, a[i] + a[(n - k) * 2 - i - 1]);
      K--;
      m -= 2;
      i += 2;
    } else {
      N = n;
      c = max(c, a[i]);
      C = a[i];
      i++;
    }
  }
  cout << c << endl;
}
