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 n, T, v[210];
long long A[210][210];
struct Mat {
  long long m[110][110];
} M[25];
inline long long oper(long long a, long long b) {
  return (a >= 0 && b >= 0 ? a + b : -1);
}
Mat matmul(const Mat &A, const Mat &B) {
  Mat r;
  for (int i = (0); i < (n); i++)
    for (int j = (0); j < (n); j++) {
      r.m[i][j] = -1e18;
      for (int k = (0); k < (n); k++)
        r.m[i][j] = max(r.m[i][j], oper(A.m[i][k], B.m[k][j]));
    }
  return r;
}
void printmat(Mat r) {
  for (int i = (0); i < (n); i++) {
    for (int j = (0); j < (n); j++) cout << r.m[i][j] << " ";
    cout << endl;
  }
  cout << endl;
}
int main() {
  while (cin >> n >> T) {
    for (int i = (0); i < (n); i++) {
      cin >> v[i];
      v[i + n] = v[i];
      A[i][i] = 0;
    }
    for (int len = (1); len < (2 * n); len++)
      for (int i = (0); i < (2 * n - len); i++) {
        int j = i + len;
        A[i][j] = -1;
        for (int t = i + 1; t <= j; t++)
          if (v[i] <= v[t] && v[t] <= v[j]) A[i][j] = max(A[i][j], 1 + A[t][j]);
      }
    for (int i = (0); i < (n); i++)
      for (int j = (0); j < (n); j++) M[0].m[i][j] = A[i][j + n];
    for (int p = (1); p < (25); p++) M[p] = matmul(M[p - 1], M[p - 1]);
    Mat R;
    for (int i = (0); i < (n); i++)
      for (int j = (0); j < (n); j++) R.m[i][j] = (i == j ? 0 : -1);
    long long maxi = 0;
    if (T == 1) {
      for (int i = (0); i < (n); i++)
        for (int j = (i); j < (n); j++) maxi = max(maxi, A[i][j]);
    } else {
      T--;
      for (int p = 0; (1 << p) <= T; p++)
        if ((T >> p) & 1) {
          R = matmul(R, M[p]);
        }
      for (int i = (0); i < (n); i++)
        for (int j = (0); j < (n); j++) maxi = max(maxi, R.m[i][j]);
    }
    cout << maxi + 1 << endl;
  }
  return 0;
}
