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>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const int MAXN = 100 * 100 + 10;
const int MOD = 1e9 + 7;
const int dir[][2] = {{1, 0}, {0, -1}, {-1, 0}, {0, 1}};
const int seed = 131;
int cases = 0;
int n;
vector<int> arr, tmp, pre, last, ori;
int get_lis(vector<int> &a) {
  int ans = 0;
  vector<int> tmp;
  for (int i = 0; i < (int)arr.size(); i++) {
    a.push_back(upper_bound(tmp.begin(), tmp.end(), arr[i]) - tmp.begin() + 1);
    ans = max(ans, a[i]);
    if (a[i] == (int)tmp.size() + 1)
      tmp.push_back(arr[i]);
    else
      tmp[a[i] - 1] = arr[i];
  }
  return ans;
}
void build(int k) {
  for (int i = n; i < n * k; i++) arr.push_back(arr[i - n]);
}
int main() {
  int k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    int tmp;
    scanf("%d", &tmp);
    arr.push_back(tmp);
  }
  if (k <= 2 * n) {
    build(k);
    printf("%d\n", get_lis(pre));
    return 0;
  }
  ori = arr;
  build(n);
  get_lis(pre);
  for (int &i : arr) i = 301 - i;
  reverse(arr.begin(), arr.end());
  get_lis(last);
  reverse(last.begin(), last.end());
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    for (int j : ori)
      if (j == ori[i]) cnt++;
    for (int j = 0; j < n; j++)
      if (ori[j] >= ori[i]) {
        ans = max(ans, pre[(n - 1) * n + i] + cnt * (k - 2 * n) + last[j]);
      }
  }
  printf("%d\n", ans);
  return 0;
}
