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>
inline long long sbt(long long x) { return __builtin_popcount(x); }
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
map<long long, long long> freq;
int32_t main() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  long long n, t;
  cin >> n >> t;
  long long dp[n * n + 13], a[n + 13], maxi = 1;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    freq[a[i]]++;
    maxi = max(maxi, freq[a[i]]);
  }
  memset(dp, 0, sizeof dp);
  vector<long long> v;
  for (long long i = 1; i <= min(n, t); i++) {
    for (long long j = 1; j <= n; j++) {
      v.push_back(a[j]);
    }
  }
  for (long long i = 0; i < v.size(); i++) {
    dp[i] = 1;
    for (long long j = 0; j < i; j++) {
      if (v[i] >= v[j]) {
        dp[i] = max(dp[i], dp[j] + 1);
      }
    }
  }
  long long lis = *max_element(dp, dp + v.size());
  if ((n * t) > (n * n)) {
    cout << lis + (t - n) * maxi;
  } else {
    cout << lis;
  }
  return 0;
}
