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;
int a[110], b[110], f[110];
int n, m, T;
vector<vector<int> > A, ans, tmp;
void multi(vector<vector<int> > A, vector<vector<int> > B,
           vector<vector<int> > &C) {
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < m; j++) {
      tmp[i][j] = 0;
      for (int k = i; k <= j; k++) {
        tmp[i][j] = max(tmp[i][j], A[i][k] + B[k][j]);
      }
    }
  }
  C = tmp;
}
int main() {
  scanf("%d %d", &n, &T);
  for (int i = 0; i < n; i++) scanf("%d", a + i), b[i] = a[i];
  sort(b, b + n);
  m = unique(b, b + n) - b;
  for (int i = 0; i < n; i++) a[i] = lower_bound(b, b + m, a[i]) - b;
  A.resize(m);
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < m; j++) f[j] = 0;
    bool bf = 0;
    for (int k = 0; k < n; k++) {
      if (bf && a[k] >= i) {
        int mx = 0;
        for (int j = i; j <= a[k]; j++) mx = max(mx, f[j] + 1);
        f[a[k]] = mx;
      } else if (a[k] == i) {
        bf = 1;
        f[i] = 1;
      }
    }
    A[i].resize(m);
    for (int j = i; j < m; j++) {
      A[i][j] = f[j];
      f[j + 1] = max(f[j], f[j + 1]);
    }
  }
  ans.resize(m);
  tmp.resize(m);
  for (int i = 0; i < m; i++) {
    ans[i].resize(m);
    tmp[i].resize(m);
  }
  for (; T; T >>= 1) {
    if (T & 1) multi(ans, A, ans);
    multi(A, A, A);
  }
  int res = 0;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < m; j++)
      if (res < ans[i][j]) res = ans[i][j];
  }
  printf("%d\n", res);
  return 0;
}
