#include <bits/stdc++.h>
using namespace std;
int data[100], n, k;
int calc() {
  int res = 0;
  for (int i = 0; i + k <= n; i++) {
    int tmp = 1;
    for (int j = 0; j < k; j++) {
      tmp *= data[i + j];
    }
    res = max(res, tmp);
  }
}
int main() {
  while (cin >> n >> k && (n | k)) {
    for (int i = 0; i < n; i++) {
      cin >> data[i];
    }
    int ck = calc();
    int ans = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        int tmp = data[i];
        data[i] = data[j];
        data[j] = tmp;
        ans = max(ans, calc());
        data[j] = data[i];
        data[i] = tmp;
      }
    }
    if (ans < ck)
      cout << "NO GAME" << endl;
    else
      cout << ans - ck << endl;
  }
}
