#include <bits/stdc++.h>
const int INF = 1 << 24;
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1},
          dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};
int main() {
  int N, K;
  while (std::cin >> N >> K, N) {
    int cards[100];
    for (int i = (0); i < (N); i++) {
      std::cin >> cards[i];
    }
    int C = 0, c = 1;
    for (int i = (0); i < (K); i++) {
      c *= cards[i];
    }
    for (int i = (K); i < (N); i++) {
      c = c / cards[i - K] * cards[i];
      C = std::max(C, c);
    }
    int C_ = 0;
    for (int i = (0); i < (N); i++) {
      for (int j = (i + 1); j < (N); j++) {
        std::swap(cards[i], cards[j]);
        int c_, c = 1;
        for (int k = (0); k < (K); k++) {
          c *= cards[k];
        }
        for (int k = (K); k < (N); k++) {
          c = c / cards[k - K] * cards[k];
          c_ = std::max(c_, c);
        }
        std::swap(cards[i], cards[j]);
        C_ = std::max(C_, c_);
      }
    }
    if (C_ - C < 0) {
      puts("NOGAME");
    } else {
      printf("%d\n", C_ - C);
    }
  }
}
