#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  while (1) {
    cin >> n >> k;
    if (n == 0 && k == 0) break;
    int a[101] = {};
    for (int i = 0; i < n; i++) cin >> a[i];
    int ck = -1;
    int site = 0;
    for (int i = 0; i <= n - k; i++) {
      int t = 1;
      for (int j = 0; j < k; j++) t *= a[j + i];
      if (ck < t) ck = t, site = i;
    }
    int nmin = 100000;
    int site2;
    for (int i = 0; i < k; i++)
      if (a[site + i] < nmin) nmin = a[site + i], site2 = i + site;
    int amax = a[site2];
    for (int i = 0; i < n; i++) {
      if (site < i && i < site + k) continue;
      if (amax < a[i]) amax = a[i];
    }
    int ck2 = (ck / a[site2]) * amax;
    if (ck2 - ck <= 0 && n - k <= 1)
      cout << "NO GAME" << endl;
    else
      cout << ck2 - ck << endl;
  }
  return 0;
}
