#include <bits/stdc++.h>
using namespace std;
int n, p;
int c[114];
int getscore() {
  int ret = 1;
  int i, j;
  for (i = 0; i < n; i++) {
    int score = 1;
    for (j = 0; j < p; j++) {
      if (i + j >= n) break;
      score *= c[i + j];
    }
    if (j == p) ret = max(score, ret);
  }
  return ret;
}
int main() {
  int i, j, k;
  cin >> n >> p;
  for (i = 0; i < n; i++) cin >> c[i];
  int Score = getscore();
  int ans = -1;
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      c[i] = c[i] + c[j];
      c[j] = c[i] - c[j];
      c[i] = c[i] - c[j];
      int score = getscore();
      ans = max(ans, score - Score);
      c[i] = c[i] + c[j];
      c[j] = c[i] - c[j];
      c[i] = c[i] - c[j];
    }
  }
  if (ans == -1)
    cout << "NO GAME" << endl;
  else
    cout << ans << endl;
  return 0;
}
