#include <bits/stdc++.h>
using namespace std;
int calc(int n, int k, int c[]) {
  int res = 0;
  int seki = 1;
  for (int i = 0; i < n; ++i) {
    if (i - k >= 0) res /= c[i - k];
    seki *= c[i];
    if (i + 1 >= k) res = max(res, seki);
  }
  return res;
}
int main() {
  int n, k, c[101];
  while (cin >> n >> k && (n | k)) {
    for (int i = 0; i < n; ++i) {
      cin >> c[i];
    }
    int C0 = calc(n, k, c);
    int C1 = 0;
    for (int i = 0; i < n; ++i) {
      for (int j = i + 1; j < n; ++j) {
        swap(c[i], c[j]);
        C1 = max(C1, calc(n, k, c));
        swap(c[i], c[j]);
      }
    }
    if (C1 - C0 < 0)
      cout << "NO GAME" << endl;
    else
      cout << C1 - C0 << endl;
  }
  return 0;
}
