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 arr[101];
int lis[200101];
int solve_another_more(int n, int t, int more, bool less) {
  int nt = n * t, c = 0;
  for (int j = 0; j < t; j++) {
    for (int i = 0; i < n; i++) {
      if (less == false && arr[i] < more)
        continue;
      else if (less == true && arr[i] > more)
        continue;
      int place = upper_bound(lis, lis + c, arr[i]) - lis;
      if (place == c) c++;
      lis[place] = arr[i];
    }
  }
  return c;
}
map<int, int> M;
int main() {
  int n, t;
  scanf("%d%d", &n, &t);
  for (int i = 0; i < n; i++) {
    scanf("%d", arr + i);
    M[arr[i]]++;
  }
  if (n * t <= 200000) {
    printf("%d\n", solve_another_more(n, t, 0, 0));
    return 0;
  }
  int element = arr[0], maxcount = M[arr[0]];
  for (map<int, int>::iterator it = M.begin(); it != M.end(); it++) {
    if (it->second > maxcount) {
      maxcount = it->second;
      element = it->first;
    }
  }
  printf("%d\n", solve_another_more(n, 300, element, false) +
                     solve_another_more(n, 300, element, true) +
                     (t - 600) * maxcount);
  return 0;
}
