#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

const int INF = 1 << 24;
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

typedef unsigned long long ull;
typedef std::pair<int,int> P;

int main(){
    int N, K;
    while(std::cin >> N >> K, N){
        int cards[100];
        REP(i, N){
            std::cin >> cards[i];
        }
    
        int C = 0, c = 1;
        REP(i, K){
            c *= cards[i];
        }
        C = c;
            
        FOR(i, K, N){
            c = c / cards[i-K] * cards[i];
            C = std::max(C, c);
        }

        int C_ = 0;
        REP(i, N){
            FOR(j, i+1, N){
                std::swap(cards[i], cards[j]);

                int c = 1;

                REP(k, K){
                    c *= cards[k];
                }
                C_ = std::max(C_, c);

                FOR(k, K, N){
                    c = c / cards[k-K] * cards[k];
                    C_ = std::max(C_, c);
                }

                std::swap(cards[i], cards[j]);
            }
        }

        // printf("%d, %d\n", C, C_);
        if(C_ - C < 0){
            puts("NOGAME");
        }else{
            printf("%d\n", C_-C);
        }
    }
}