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 = 200 + 10, inf = 1e9;
int a[MAXN], f[MAXN], n, T;
int A[MAXN][MAXN], ret[MAXN][MAXN];
void mul(int A[MAXN][MAXN], int B[MAXN][MAXN]) {
  int C[MAXN][MAXN];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      C[i][j] = -inf;
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      for (int k = 0; k < n; ++k) {
        C[i][j] = max(C[i][j], A[i][k] + B[k][j]);
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      A[i][j] = C[i][j];
    }
  }
}
int main() {
  cin >> n >> T;
  for (int i = 0; i < n; ++i) cin >> a[i];
  if (T == 1) {
    int mx(0);
    for (int i = 0; i < n; ++i) {
      f[i] = 1;
      for (int j = 0; j < i; ++j) {
        if (a[j] <= a[i]) f[i] = max(f[i], f[j] + 1);
      }
      mx = max(mx, f[i]);
    }
    cout << mx << endl;
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      A[i][j] = -inf;
      ret[i][j] = 0;
    }
  }
  for (int i = 0; i < n; ++i) a[i + n] = a[i];
  for (int s = 0; s < n; ++s) {
    for (int i = 0; i < MAXN; ++i) f[i] = -1e9;
    for (int i = s; i < n * 2; ++i)
      if (a[i] >= a[s]) {
        f[i] = 1;
        for (int j = s; j < i; ++j)
          if (a[j] >= a[s]) {
            if (a[j] <= a[i]) f[i] = max(f[i], f[j] + 1);
          }
        if (i >= n) A[s][i % n] = f[i] - 1;
      }
  }
  T--;
  for (; T; T >>= 1) {
    if (T & 1) mul(ret, A);
    mul(A, A);
  }
  int ans(0);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      ans = max(ans, ret[i][j]);
    }
  }
  cout << ans + 1 << endl;
  return 0;
}
