#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, K, c[100], CK, M1, M2, tmp, CK2, cnt = 0;
  int i, j, k, l;
  while (cnt < 100) {
    cnt++;
    cin >> n >> K;
    if (n == 0 && K == 0) break;
    for (i = 0; i < n; i++) cin >> c[i];
    M1 = 0;
    M2 = 0;
    for (i = 0; i < n - K + 1; i++) {
      CK = 1;
      for (j = i; j < i + K; j++) {
        CK *= c[j];
      }
      if (CK > M1) M1 = CK;
    }
    for (i = 0; i < n - 1; i++) {
      for (j = i + 1; j < n; j++) {
        tmp = c[i];
        c[i] = c[j];
        c[j] = tmp;
        for (k = 0; k < n - K + 1; k++) {
          CK2 = 1;
          for (l = k; l < k + K; l++) {
            CK2 *= c[l];
          }
          if (CK2 > M2) M2 = CK2;
          cout << "M2：" << M2 << endl;
        }
        tmp = c[i];
        c[i] = c[j];
        c[j] = tmp;
      }
    }
    if (M1 <= M2)
      cout << M2 - M1 << endl;
    else
      cout << "NO GAME" << endl;
  }
  return 0;
}
