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;
const int maxn = 1e2 + 10, inf = 1e9;
struct mat {
  int n, m, mtx[maxn][maxn];
  mat(int _n, int _m, int val = -inf) {
    n = _n, m = _m;
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < m; ++j) mtx[i][j] = val;
  }
  int* operator[](int x) { return mtx[x]; }
  mat operator*(mat x) {
    mat ans(n, x.m);
    for (int i = 0; i < ans.n; ++i)
      for (int j = 0; j < ans.m; ++j)
        for (int k = 0; k < m; ++k)
          ans[i][j] = max(ans[i][j], mtx[i][k] + x[k][j]);
    return ans;
  }
  void operator*=(mat x) { *this = *this * x; };
  mat operator^(int power) {
    mat ans = *this, a = *this;
    power--;
    for (; power; power >>= 1, a *= a)
      if (power & 1) ans *= a;
    return ans;
  }
  void operator^=(int power) { *this = *this ^ power; }
};
int n, t, dp[maxn << 1][maxn << 1], a[maxn << 1], ans;
int main() {
  cin >> n >> t;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    a[i + n] = a[i];
    dp[i][i] = 1, dp[i + n][i + n] = 1;
  }
  for (int i = 1; i < (n << 1); ++i)
    for (int j = 0; j < (n << 1) - i; ++j)
      if (a[j] <= a[i + j]) {
        dp[j][i + j] = 2;
        for (int k = j + 1; k < i + j; ++k)
          dp[j][i + j] = max(dp[j][i + j], dp[j][k] + dp[k][i + j] - 1);
      } else
        dp[j][i + j] = -inf;
  mat base_m(1, n), main_m(n, n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) main_m[j][i] = dp[j][i + n] - 1;
    for (int j = 0; j <= i; ++j) base_m[0][i] = max(base_m[0][i], dp[j][i]);
  }
  if (t - 1) base_m *= main_m ^ (t - 1);
  for (int i = 0; i < n; ++i) ans = max(ans, base_m[0][i]);
  cout << ans << '\n';
  return 0;
}
