#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int n, k;

int get_ck(vector<int> c){
	int p = 0;
	for(int i=0 ; i+k <= c.size() ; i++ ){
		int s = 1;
		for(int j = 0 ; j < k ; j++ ){
			s *= c[i+j];
		}
		p = max( s , p );
	}
	return p;
}

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