#include <bits/stdc++.h>
using namespace std;
double EPS = 1e-9;
int conversion(string p) {
  int o;
  o = atoi(p.c_str());
  return o;
}
string toString(int h) {
  stringstream ss;
  ss << h;
  return ss.str();
}
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return (a * (b / gcd(a, b))); }
long long toi(string p) {
  long long x;
  istringstream in(p);
  in >> x;
  return x;
}
long long square(long long n) { return n * n; }
long long fastexp(long long base, long long power) {
  if (power == 0)
    return 1LL;
  else if (power % 2 == 0)
    return square(fastexp(base, power / 2));
  else
    return base * (fastexp(base, power - 1));
}
bool is_prime(int n) {
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
int logba(int a, int b) { return log(a) / log(b); }
int rd(double d) {
  int x = (int)((double)d + 0.5);
  return x;
}
int main() {
  int n, k, x, cant = 0, maxi = 0;
  cin >> n >> k;
  vector<int> M;
  for (int i = 0; i < n; i++) {
    cin >> x;
    M.push_back(x);
  }
  vector<int> A, B;
  for (int i = n - 1; i >= 0; i--) {
    if (cant < k)
      B.push_back(M[i]);
    else
      A.push_back(M[i]);
    cant++;
  }
  reverse(B.begin(), B.end());
  cant = 0;
  for (int i = 0; i < B.size(); i++) {
    if (cant < A.size())
      maxi = max(maxi, A[i] + B[i]);
    else
      maxi = max(maxi, B[i]);
    cant++;
  }
  cout << maxi << endl;
}
