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 gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
int A[100], B[40200], n, N, M[40200];
long long r1;
int lis() {
  int L = 0, lo, hi, mid, i;
  for (i = 0; i < N; i++) {
    lo = 1;
    hi = L;
    while (lo <= hi) {
      mid = (lo + hi) / 2 + ((lo + hi) % 2);
      if (B[M[mid]] <= B[i])
        lo = mid + 1;
      else
        hi = mid - 1;
    }
    M[lo] = i;
    if (lo > L) L = lo;
    if (i == N - n - 1) r1 = L;
  }
  return L;
}
int main() {
  int T, i, j, k;
  long long r2;
  scanf("%d%d", &n, &T);
  for (i = 0; i < n; i++) {
    scanf("%d", &A[i]);
  }
  if (T <= 401) {
    for (i = 0, j = 0; i < T; i++)
      for (k = 0; k < n; k++) B[j++] = A[k];
    N = n * T;
    printf("%d\n", lis());
  } else {
    for (i = 0, j = 0; i < 401; i++)
      for (k = 0; k < n; k++) B[j++] = A[k];
    N = 401 * n;
    r2 = lis();
    cout << r1 + (r2 - r1) * (T - 400) << endl;
  }
  return 0;
}
