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 = 100;
const int maxK = 300;
vector<int> V, V2, V3;
int izq[maxN + 1][maxK + 1];
int der[maxN + 1][maxK + 1];
multimap<int, int> T;
vector<int> rep(maxK + 1, 0);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n, t, z, x, mayor, ans, i, j, l;
  cin >> n >> t;
  z = n * n;
  for (i = 0; i < n; i++) {
    cin >> x;
    rep[x]++;
    V.push_back(x);
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) V2.push_back(V[j]);
    for (j = n - 1; j >= 0; j--) V3.push_back(V[j]);
  }
  vector<int> DP(z, 1), DP2(maxK + 1, 0);
  for (j = 0; j <= maxK; j++) {
    izq[0][j] = 0;
  }
  for (i = 0; i < z; i++) {
    for (j = 0; j <= V2[i]; j++) DP[i] = max(DP[i], DP2[j] + 1);
    DP2[V2[i]] = DP[i];
    if ((i + 1) % n == 0) {
      mayor = 0;
      for (j = 0; j <= maxK; j++) {
        mayor = max(mayor, DP2[j]);
        izq[(i + 1) / n][j] = mayor;
      }
    }
  }
  T.clear();
  DP.clear();
  DP.resize(z, 0);
  DP2.clear();
  DP2.resize(maxK + 1, 0);
  for (j = 0; j <= maxK; j++) {
    der[0][j] = 0;
  }
  for (i = 0; i < z; i++) {
    for (j = maxK; j >= V3[i]; j--) DP[i] = max(DP[i], DP2[j] + 1);
    DP2[V3[i]] = DP[i];
    if ((i + 1) % n == 0) {
      mayor = 0;
      for (j = maxK; j >= 0; j--) {
        mayor = max(mayor, DP2[j]);
        der[(i + 1) / n][j] = mayor;
      }
    }
  }
  ans = 0;
  for (i = 0; i <= maxK; i++) {
    for (j = 0; j <= n; j++) {
      for (l = 0; l <= n; l++) {
        x = t - (j + l);
        if (x >= 0) ans = max(ans, izq[j][i] + der[l][i] + x * rep[i]);
      }
    }
  }
  cout << ans << '\n';
}
