#include <bits/stdc++.h>
using namespace std;
int n, k, x[100];
int getpoint() {
  if (n < k) {
    return 0;
  }
  int sum = 1, maxd = 1;
  for (int i = 0; i < k; i++) {
    sum *= x[i];
  }
  maxd = sum;
  for (int i = 0; i < n - k; i++) {
    sum /= x[i];
    sum *= x[i + k];
    maxd = max(maxd, sum);
  }
  return maxd;
}
int main() {
  while (true) {
    cin >> n >> k;
    if (n == 0 && k == 0) {
      break;
    }
    for (int i = 0; i < n; i++) {
      cin >> x[i];
    }
    int point = getpoint();
    int maxn = 0;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        int a = x[i], b = x[i + 1];
        x[i + 1] = a;
        x[i] = b;
        maxn = max(maxn, getpoint());
        x[i] = a;
        x[i + 1] = b;
      }
    }
    if (point > maxn) {
      cout << "NO GAME" << endl;
    } else {
      cout << point - maxn << endl;
    }
  }
  return 0;
}
