#include <iostream>
#include <cstdio>

using namespace std;

int cards[200];
int N, K;

int getMax() {
  int mx = 0;
  for (int i = 0; i < N - K + 1; i++) {
	int t = 1;
	for (int j = 0; j < K; j++) {
	  t *= cards[i + j];
	}
	mx = max(t, mx);
  }
  return mx;
}

void solve() {
  int tmax = getMax();
  int smax = 0;
  for (int i = 0; i < N; i++) {
	for (int j = i + 1; j < N; j++) {
	  swap(cards[i], cards[j]);
	  smax = max(getMax(), smax);
	  swap(cards[i], cards[j]);
	}
  }
  if (tmax > smax) {
	cout << "NO GAME" << endl;
  } else {
	cout << smax - tmax << endl;
  }
}

int main() {
  while (cin >> N >> K) {
	if (N == 0 && K == 0) {
	  break;
	}

	for (int i = 0; i < N; i++) {
	  cin >> cards[i];
	}

	solve();
  }
}