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