#include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>

#define rep(i,n) for(int i = 0; i < (n); i++ )

using namespace std;

int getCk(vector<int> &v, int k){
    int res = 0;
    rep(i, v.size()-k+1){
        int spro = 1;
        rep(j, k){
            spro *= v[i+j];
        }
        res = max(res, spro);
    }
    return res;
}

int main(){
    int n, k;
    while(cin >> n >> k, n|k){
        vector<int> v(n);
        rep(i, n) cin >> v[i];
        int ck = getCk(v, k);
        int ans = 0;
        rep(i, n){
            for(int j = i+1; j < n; j++){
                swap( v[i], v[j] );
                ans = max(ans, getCk(v, k));
                swap( v[i], v[j] );
            }
        }
        if(ck <= ans) cout << ans-ck << endl;
        else cout << "NO GAME" << endl;
    }

    return 0;
}