import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created by Antonio on 05/12/2015.
 */
public class main {

    static Integer boxes, cowbells;
    static ArrayList<Integer> bellsizes = new ArrayList<Integer>();

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String line = sc.nextLine();
        String[] tmp = line.split(" ");
        cowbells = Integer.parseInt(tmp[0]);
        boxes = Integer.parseInt(tmp[1]);

        line = sc.nextLine();
        String aux[] = line.split(" ");

        for (String tmp1 : aux)
            bellsizes.add(Integer.parseInt(tmp1));

        if (boxes >= cowbells) {
            System.out.println(bellsizes.get(bellsizes.size() - 1));
        } else {

            Integer result = 0, bigger = bellsizes.get(bellsizes.size() - 1);
            result = bigger;
            for (int i = 0; i < cowbells - boxes; i++){
                if(bigger < (bellsizes.get(i) + bellsizes.get(2 * (cowbells - boxes) - i - 1)))
                    result = (bellsizes.get(i) + bellsizes.get(2 * (cowbells - boxes) - i - 1));
            }

            System.out.println(result);
        }
    }
}
//