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 a[100];
int cp[301];
int compress[301];
int len[100][100];
int id;
int memo_deb[256][256];
int memo_fin[256][256];
int deb(int val_end, int nb_elem) {
  if (memo_deb[val_end][nb_elem] != -1) return memo_deb[val_end][nb_elem];
  if (!nb_elem) return memo_deb[val_end][0] = 0;
  int ans = 0;
  for (int p = 0; p <= val_end; p++)
    ans = max(ans, deb(p, nb_elem - 1) + len[p][val_end]);
  return memo_deb[val_end][nb_elem] = ans;
}
int fin(int val_beg, int nb_elem) {
  if (memo_fin[val_beg][nb_elem] != -1) return memo_fin[val_beg][nb_elem];
  if (!nb_elem) return memo_fin[val_beg][0] = 0;
  int ans = 0;
  for (int p = val_beg; p < id; p++)
    ans = max(ans, len[val_beg][p] + fin(p, nb_elem - 1));
  return memo_fin[val_beg][nb_elem] = ans;
}
int main() {
  scanf("%d%d", &n, &T);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    compress[a[i]] = -1;
  }
  for (int i = 0; i <= 300; i++)
    if (compress[i] == -1) compress[i] = id++;
  for (int i = 0; i < n; i++) {
    a[i] = compress[a[i]];
    cp[a[i]]++;
  }
  for (int d = 0; d < id; d++)
    for (int i = 0; i < n; i++)
      if (a[i] >= d)
        for (int p = a[i]; p >= d; p--)
          len[d][a[i]] = max(len[d][a[i]], len[d][p] + 1);
  memset(memo_deb, -1, sizeof(memo_deb));
  memset(memo_fin, -1, sizeof(memo_fin));
  int ans = fin(0, min(2 * n, T));
  if (T >= 2 * n)
    for (int i = 0; i < id; i++)
      ans = max(ans, deb(i, n) + (T - 2 * n) * cp[i] + fin(i, n));
  printf("%d\n", ans);
  return 0;
}
