#include <bits/stdc++.h>
using namespace std;
int card[200] = {};
int solve(int n, int k) {
  int maxi = -1;
  int now = 1;
  for (int i = 0; i < (k); i++) {
    now *= card[i];
  }
  for (int i = 1; i < n - k + 1; i++) {
    now = now / card[i - 1] * card[i + k - 1];
    maxi = max(maxi, now);
  }
  return maxi;
}
int main() {
  int n, k;
  while (cin >> n >> k) {
    if (n == 0 && k == 0) break;
    for (int i = 0; i < (n); i++) {
      cin >> card[i];
    }
    long long First = solve(n, k);
    int maxi = -1;
    for (int i = 0; i < (n); i++) {
      for (int j = 0; j < (n); j++) {
        swap(card[i], card[j]);
        maxi = max(maxi, solve(n, k));
        swap(card[i], card[j]);
      }
    }
    if (maxi - First < 0) {
      cout << "NO GAME" << endl;
    } else
      cout << maxi - First << endl;
  }
  return 0;
}
