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 n, T;
int s1[10101];
int dp[1010101];
int dp2[1101014];
int dp3[1000110];
int main() {
  scanf("%d%d", &n, &T);
  for (register int i = 1; i <= n; i++) scanf("%d", &s1[i]), dp[s1[i]]++;
  for (register int i = 1; i <= n * n; i++) s1[i] = s1[(i - 1) % n + 1];
  int l = n * min(n, T);
  for (register int i = 1; i <= l; i++) {
    int flag = 0;
    for (register int j = 0; j < i; j++)
      if (s1[j] <= s1[i]) flag = max(flag, dp3[j]);
    dp3[i] = flag + 1;
  }
  for (register int i = l; i >= 1; i--) {
    int flag = 0;
    for (register int j = l + 1; j > i; j--)
      if (s1[j] >= s1[i]) flag = max(flag, dp2[j]);
    dp2[i] = flag + 1;
  }
  int ans = 0;
  if (T <= n)
    for (register int i = 1; i <= l; i++) ans = max(ans, dp3[i] + dp2[i] - 1);
  else
    for (register int i = 1; i <= l; i++)
      ans = max(ans, dp3[i] + dp2[i] - 1 + dp[s1[i]] * (T - n));
  printf("%d", ans);
  return 0;
}
