#include "oriand.h"
#include <iostream>
#include <vector>

int main()
{
    int n, k;
    std::cin >> n >> k;

    std::vector<long long> a(n);
    for (int i = 0; i < n; i++)
    {
        std::cin >> a[i];
    }

    long long ans = oriand(n, k, a);
    std::cout << ans << std::endl;

    return 0;
}
