#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
#include <numeric>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

int N, K, C[102];
const char *blah = "NO GAME";

int main() {
  while (scanf("%d%d",&N,&K), N) {
    rep(i,N) scanf("%d",C+i);
    
    int Ck = -1;
    for (int i = 0; i < N-K+1; ++i) {
      int tCk = 1;
      for (int j = 0; j < K; ++j) tCk *= C[i+j];
      Ck = max(Ck, tCk);
    }

    int Cdk = -1;
    for (int i = 0; i < N; ++i) {
      for (int j = i+1; j < N; ++j) {
        swap(C[i], C[j]);
        for (int k = 0; k < N-K+1; ++k) {
          int tCdk = 1;
          for (int l = 0; l < K; ++l) tCdk *= C[k+l];
          Cdk = max(Cdk, tCdk);
        }
        swap(C[i], C[j]);
      }
    }

    if (Ck <= Cdk) {
      printf("%d\n", Cdk - Ck);
    } else {
      puts(blah);
    }
  }
  return 0;
}