import java.util.*
tailrec fun loop(): Unit {
    val (n, k) = readLine()!!.trim().split(' ').map(String::toInt)
    if (n == 0) return
    val cards = Array(n){ readLine()!!.toInt()}
    val maxSegmentTree = MaxSegmentTree(n)
    val minSegmentTree = MinSegmentTree(n)
    for ((i, c) in cards.withIndex()) {
        maxSegmentTree.increase(i, c)
        minSegmentTree.reduce(i, c)
    }
    val ck = (0 .. n - k).map { from ->
        (from until from + k).map{i -> cards[i].toLong()}.reduce(Long::times)
    }.max()!!
    val newCk = (0 .. n - k).map{from ->
        (from until from + k).map{i -> cards[i].toLong()}.reduce(Long::times) / minSegmentTree.find(from, from + k - 1) * Math.max(maxSegmentTree.find(0, from - 1), maxSegmentTree.find(from + k, n - 1))
    }.max()!!
    println(
            if (k == 1 && cards.max()!!.let{max -> cards.count{it == max} == 1}) "NO GAME" else if (newCk < ck) 0 else newCk - ck
    )
    loop()
}
class MaxSegmentTree(val size: Int){
    private val mArray = ArrayList<Array<Int>>().let{
        it.add(Array(size){Int.MIN_VALUE})
        while(it.last().size > 1){
            it.add(Array((it.last().size + 1) / 2){Int.MIN_VALUE})
        }
        it.toTypedArray()
    }
    fun increase(at: Int, to: Int): Unit {
        var position = at
        for (array in mArray){
            array[position] = Math.max(array[position], to)
            position /= 2
        }
    }
    fun find(from: Int, to: Int): Int {
        tailrec fun sub(left: Int, right: Int, depth: Int = 0, result: Int = Int.MIN_VALUE): Int {
            return if (left <= right && mArray.size > depth){
                var r = result
                if (left % 2 == 1) r = Math.max(r, mArray[depth][left])
                if (right % 2 == 0) r = Math.max(r, mArray[depth][right])
                if (left == right) r
                else sub((left + 1) / 2, (right - 1) / 2, depth + 1, r)
            }else {
                result
            }
        }
        return sub(from, to)
    }
}
class MinSegmentTree(val size: Int) {
    private val mArray = ArrayList<Array<Int>>().let{
        it.add(Array(size){Int.MAX_VALUE})
        while(it.last().size > 1){
            it.add(Array((it.last().size + 1) / 2){Int.MAX_VALUE})
        }
        it.toTypedArray()
    }
    fun reduce(at: Int, to: Int): Unit {
        var position = at
        for (array in mArray){
            array[position] = Math.min(array[position], to)
            position /= 2
        }
    }
    fun find(from: Int, to: Int): Int {
        tailrec fun sub(left: Int, right: Int, depth: Int = 0, result: Int = Int.MAX_VALUE): Int {
            return if (left <= right && mArray.size > depth){
                var r = result
                if (left % 2 == 1) r = Math.min(r, mArray[depth][left])
                if (right % 2 == 0) r = Math.min(r, mArray[depth][right])
                if (left == right) r
                else sub((left + 1) / 2, (right - 1) / 2, depth + 1, r)
            }else {
                result
            }
        }
        return sub(from, to)
    }

}
fun main(args:Array<String>?): Unit {
    loop()
}
