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, A[105], T, dp[10000000], C[10000000];
struct Bit {
  int num[105 * 3], upl;
  Bit() { memset(num, 0, sizeof(num)); }
  void Add(int x, int a) {
    while (x <= upl) {
      num[x] = max(num[x], a);
      x += (x & -x);
    }
  }
  int Ask(int x) {
    int res = 0;
    while (x) {
      res = max(num[x], res);
      x -= x & -x;
    }
    return res;
  }
} Tr;
int cnt[305];
int main() {
  scanf("%d %d", &n, &T);
  for (int i = 0; i < n; i++) scanf("%d", &A[i]), cnt[A[i]]++;
  int ans = 0, k = 0;
  int m = min(n, T), mx = 0;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) C[k++] = A[j], mx = max(cnt[A[i]], mx);
  }
  Tr.upl = 304;
  for (int i = 0; i < k; i++) {
    dp[i] = Tr.Ask(A[i % n]) + 1;
    Tr.Add(A[i % n], dp[i]);
    ans = max(ans, dp[i] + (T - m) * mx);
  }
  printf("%d\n", ans);
  return 0;
}
