#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k;
  while (cin >> n >> k, n || k) {
    vector<int> card(n);
    for (int i = 0; i < n; ++i) {
      cin >> card[i];
    }
    int Ck = 0;
    for (int i = 0; i < n - k + 1; ++i) {
      int a = 1;
      for (int j = 0; j < k; ++j) {
        a *= card[i + j];
      }
      Ck = max(Ck, a);
    }
    int maxCk = 0;
    for (int i = 0; i < n - 1; ++i) {
      for (int j = i + 1; j < n; ++j) {
        int temp = card[i];
        card[i] = card[j];
        card[j] = temp;
        int CkNow = 0;
        for (int k = 0; k < n - k + 1; ++k) {
          int a = 1;
          for (int l = 0; l < k; ++l) {
            a *= card[k + l];
          }
          CkNow = max(CkNow, a);
        }
        maxCk = max(maxCk, CkNow);
        temp = card[i];
        card[i] = card[j];
        card[j] = temp;
      }
    }
    if (maxCk - Ck == 0) {
      cout << "NO GAME" << endl;
    } else {
      cout << maxCk - Ck << endl;
    }
  }
}
int main() {
  solve();
  return (0);
}
