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

int c[100], n, k;

int rec(){
  int ret = 0;
  for(int i = 0 ; i <= n - k ; i++ ){
    int res = 1;
    for(int j = 0 ; j < k ; j++ ){
      res *= c[i + j];
    }
    ret = max( ret, res);
  }
  return ret;
}

int main(){

  while( cin >> n >> k, n){
    for(int i = 0 ; i < n ; i++ ){
      cin >> c[i];
    }

    int ck = rec();
    int ret = -1;

    for(int i = 0 ; i < n ; i++ ){
      for(int j = i + 1 ; j < n ; j++ ){
        swap( c[i], c[j]);
        ret = max( rec() - ck, ret);
        swap( c[j], c[i]);
      }
    }

    if(ret == -1) cout << "NOGAME" << endl;
    else cout << ret << endl;
  }
}