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 main(int argv, char** argc) {
  cin.sync_with_stdio(0);
  long long n, T;
  cin >> n >> T;
  int nums[n];
  for (typeof(n) i = 0; i < n; i++) {
    cin >> nums[i];
  }
  map<long long, long long> numcount;
  long long mostcount = 0;
  for (typeof(n) i = 0; i < n; i++) {
    numcount[nums[i]]++;
    mostcount = max(mostcount, numcount[nums[i]]);
  }
  vector<int> lisnums;
  long long tomake = min(n, T);
  T -= tomake;
  for (typeof(tomake) i = 0; i < tomake; i++) {
    for (typeof(n) j = 0; j < n; j++) {
      lisnums.push_back(nums[j]);
    }
  }
  vector<long long> lis(lisnums.size(), 1);
  for (typeof(lis.size()) i = 0; i < lis.size(); i++) {
    ;
    for (int j = i - 1; j >= 0; j--) {
      if (lisnums[j] <= lisnums[i]) {
        lis[i] = max(lis[i], lis[j] + 1);
      }
    }
  }
  long long max_lis = *max_element(lis.begin(), lis.end());
  long long answer = max_lis + T * mostcount;
  cout << answer << endl;
  return 0;
}
