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 LIS(vector<int>& v) {
  int n = v.size();
  vector<int> d(n + 1);
  int INF = 1000000000;
  d[0] = -INF;
  for (int i = 1; i <= n; ++i) d[i] = INF;
  for (int i = 0; i < n; i++) {
    int j = int(upper_bound(d.begin(), d.end(), v[i]) - d.begin());
    if (d[j - 1] <= v[i] && v[i] < d[j]) d[j] = v[i];
  }
  for (int i = n; i >= 0; --i)
    if (d[i] != INF) return i;
}
void sum(vector<int>& a, vector<int>& b) {
  for (int i = 0; i < b.size(); ++i) {
    a.push_back(b[i]);
  }
}
int main() {
  int n, t;
  cin >> n >> t;
  vector<int> v(n);
  int maxval = 500;
  vector<int> count(maxval, 0);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
    ++count[v[i]];
  }
  vector<int> big;
  int T = min(300, t);
  for (int i = 1; i <= T; ++i) {
    sum(big, v);
  }
  int ans = LIS(big);
  int MAX = -1;
  for (int i = 0; i < maxval; ++i) {
    MAX = max(MAX, count[i]);
  }
  cout << ans + (t - T) * MAX << endl;
  return 0;
}
