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>
char _;
using namespace std;
int N, T, A[101], dp[10001], ct[301];
int main() {
  scanf("%d%d", &N, &T);
  int m = 0;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &A[i]);
    ct[A[i]]++;
    m = max(m, ct[A[i]]);
  }
  int l = min(100, T);
  int ans = 0;
  for (int i = 0; i < l * N; ++i) {
    for (int j = max(i - N, 0); j < i; ++j)
      if (A[j % N] <= A[i % N]) dp[i] = max(dp[i], dp[j] + 1);
    dp[i] = max(dp[i], 1);
    ans = max(ans, dp[i]);
  }
  ans += (T - l) * m;
  printf("%d", ans);
  return 0;
}
