You are given an array of positive integers a1, a2, ..., an × T of length n × T. We know that for any i > n it is true that ai = ai - n. Find the length of the longest non-decreasing sequence of the given array.

Input

The first line contains two space-separated integers: n, T (1 ≤ n ≤ 100, 1 ≤ T ≤ 107). The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 300).

Output

Print a single number — the length of a sought sequence.

Examples

Input

4 3
3 1 4 2


Output

5

Note

The array given in the sample looks like that: 3, 1, 4, 2, 3, 1, 4, 2, 3, 1, 4, 2. The elements in bold form the largest non-decreasing subsequence. 
#include <bits/stdc++.h>
using namespace std;
inline void read() {}
template <typename T, typename... Ts>
inline void read(T& A, Ts&... As) {
  T x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  A = x * f, read(As...);
}
inline void write(char a) { putchar(a); }
template <typename T>
inline void write(T a) {
  if (a < 0ll) putchar('-'), a = -a;
  if (a > 9ll) write(a / 10ll);
  putchar(a % 10ll + '0');
}
template <typename T, typename... Ts>
inline void write(T A, Ts... As) {
  write(A), write(As...);
}
const int N = 110, K = 110;
int n, t;
long long a[N * (K + 1)], dp[N * (K + 1)], res;
signed main() {
  read(n, t);
  for (register int i = 1; i <= n; ++i) read(a[i]);
  for (register int i = n + 1; i <= K * n; ++i) a[i] = a[i - n];
  for (register int i = 1; i <= K * n; ++i) {
    dp[i] = 1;
    for (register int j = max(i - n, 1); j < i; ++j) {
      if (a[j] <= a[i]) dp[i] = max(dp[i], dp[j] + 1);
    }
  }
  if (t <= K) {
    for (register int i = 1; i <= n * t; ++i) res = max(res, dp[i]);
    write(res);
    return 0;
  } else {
    for (register int i = (K - 1) * n + 1; i <= K * n; ++i) {
      res = max(res, dp[i] + (dp[i] - dp[i - n]) * (t - K));
    }
    write(res);
  }
  return 0;
}
