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;
const int N = 10000 + 10;
int a[N], f[N], d[N];
int bsearch(const int *f, int size, const int &a) {
  int l = 0, r = size - 1;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (a >= d[mid - 1] && a < d[mid])
      return mid;
    else if (a < d[mid])
      r = mid - 1;
    else
      l = mid + 1;
  }
}
int LIS(const int *a, const int &n) {
  int i, j, size = 1;
  d[0] = a[0];
  f[0] = 1;
  for (i = 1; i < n; ++i) {
    if (a[i] < d[0])
      j = 0;
    else if (a[i] >= d[size - 1])
      j = size++;
    else
      j = bsearch(d, size, a[i]);
    d[j] = a[i];
    f[i] = j + 1;
  }
  return size;
}
int n, T;
const int maxn = 300 + 10;
int num[maxn];
int main() {
  scanf("%d %d", &n, &T);
  memset(num, 0, sizeof(num));
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    num[a[i]]++;
  }
  int Max = 0;
  for (int i = 0; i < n; i++) {
    if (num[a[i]] > Max) Max = num[a[i]];
  }
  if (n >= T) {
    for (int i = n; i < n * T; i++) a[i] = a[i - n];
    int ans = LIS(a, n * T);
    printf("%d", ans);
  } else {
    for (int i = n; i <= n * n; i++) a[i] = a[i - n];
    int ans = LIS(a, n * n);
    ans = ans + (T - n) * Max;
    printf("%d", ans);
  }
}
