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 a[310], ls, tr[310], n, Q, ans, ans1, lim;
long long T;
void add(int x, int a) {
  for (; x <= lim; x += x & -x) tr[x] = max(tr[x], a);
}
int query(int x) {
  int ans = 0;
  for (; x; x -= x & -x) ans = max(ans, tr[x]);
  return ans;
}
int main() {
  Q = 1;
  while (Q--) {
    scanf("%d%lld", &n, &T), ans = ans1 = 0;
    lim = 300;
    for (int i = 1; i <= lim; ++i) tr[i] = 0;
    for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    int cir = min((long long)n, T) * n;
    for (int i = 1, j = 0; i <= cir; ++i) {
      if (j == n)
        j = 1;
      else
        j++;
      add(a[j], ls = query(a[j]) + 1);
      ans = max(ans, ls);
    }
    if (n >= T) {
      printf("%d\n", ans);
      continue;
    } else {
      for (int i = 1; i <= n; ++i) {
        add(a[i], ls = query(a[i]) + 1);
        ans1 = max(ans1, ls);
      }
      printf("%lld\n", ans + (ans1 - ans) * (T - n));
    }
  }
}
