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;
bool cmp_pair_F_2(pair<int, int> x, pair<int, int> y) {
  return x.first > y.first;
}
bool cmp_pair_S_2(pair<int, int> x, pair<int, int> y) {
  return x.second > y.second;
}
bool cmp_pair_S_1(pair<int, int> x, pair<int, int> y) {
  return x.second < y.second;
}
bool cmp(int x, int y) { return x > y; }
int lis(vector<int> v) {
  int n = v.size();
  vector<int> dp(n + 10, 1e6);
  for (int i = 0; i < n; i++) {
    vector<int>::iterator it = upper_bound(dp.begin(), dp.end(), v[i]);
    dp[it - dp.begin()] = min(dp[it - dp.begin()], v[i]);
  }
  return lower_bound(dp.begin(), dp.end(), 1e6) - dp.begin();
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int i, j;
  int n, t;
  cin >> n >> t;
  int a[n];
  vector<int> m(500, 0);
  for (i = 0; i < n; i++) cin >> a[i], m[a[i]]++;
  vector<int> v;
  for (i = 0; i < min(t, 100); i++)
    for (j = 0; j < n; j++) v.push_back(a[j]);
  if (t <= 100)
    cout << lis(v);
  else {
    int num = 0;
    for (i = 0; i < 500; i++)
      if (m[i] > num) num = max(m[i], num);
    cout << lis(v) + (t - 100) * num;
  }
  return 0;
}
