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 long long N = 1e6 + 2;
long long dp[N];
vector<long long> lis(long long *a, long long n, long long fac) {
  vector<long long> dp(n * fac + 1, 0);
  vector<long long> last(302, -1);
  for (long long i = 0; i < n * fac; ++i) {
    dp[i] = 1;
    long long val = a[i % n];
    for (long long j = 1; j <= val; ++j) {
      if (last[j] != -1) dp[i] = max(dp[i], 1 + dp[last[j]]);
    }
    last[val] = i;
  }
  return dp;
}
vector<long long> lis2(long long *a, long long n, long long fac) {
  vector<long long> dp(n * fac + 1, 0);
  vector<long long> last(302, -1);
  for (long long i = n * fac - 1; i >= 0; --i) {
    long long val = a[i % n];
    dp[i] = 1;
    for (long long j = val; j <= 300; ++j) {
      if (last[j] != -1) dp[i] = max(dp[i], 1 + dp[last[j]]);
    }
    last[val] = i;
  }
  return dp;
}
void solve() {
  long long n, t;
  cin >> n >> t;
  long long a[n];
  for (long long i = 0; i < n; ++i) cin >> a[i];
  if (t <= 3 * n) {
    auto vec = lis(a, n, t);
    long long mx = *max_element(vec.begin(), vec.end());
    cout << mx << '\n';
    return;
  }
  long long fre[302];
  memset(fre, 0, sizeof fre);
  for (long long i = 0; i < n; ++i) fre[a[i]]++;
  long long kitna = t - 2 * n;
  for (long long i = 1; i <= 300; ++i) fre[i] *= kitna;
  long long ans = 0;
  auto aav = lis(a, n, n);
  long long in[302];
  memset(in, 0, sizeof in);
  long long dec[302];
  memset(dec, 0, sizeof dec);
  for (long long i = 0; i < aav.size(); ++i) {
    long long val = a[i % n];
    in[val] = max(in[val], aav[i]);
  }
  auto ava = lis2(a, n, n);
  for (long long i = 0; i < ava.size(); ++i) {
    long long val = a[i % n];
    dec[val] = max(dec[val], ava[i]);
  }
  for (long long i = 1; i <= 300; ++i) {
    ans = max(ans, in[i] + fre[i] + dec[i]);
  }
  cout << ans << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long t = 1;
  while (t--) solve();
}
