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;
void fre() {
  freopen("c://test//input.in", "r", stdin);
  freopen("c://test//output.out", "w", stdout);
}
template <class T1, class T2>
inline void gmax(T1 &a, T2 b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline void gmin(T1 &a, T2 b) {
  if (b < a) a = b;
}
const int N = 1e4 + 1e3, M = 0, Z = 1e9 + 7, ms63 = 1061109567;
int casenum, casei;
int n, m, T;
int a[N], f[N];
int main() {
  while (~scanf("%d%d", &n, &T)) {
    int cir = min(100, T);
    int len = cir * n;
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    int ans = 0;
    for (int i = 1; i <= len; i++) {
      if (i > n) a[i] = a[i - n];
      f[i] = 1;
      int st = max(1, i - n);
      for (int j = st; j < i; j++)
        if (a[j] <= a[i]) gmax(f[i], f[j] + 1);
      gmax(ans, f[i]);
    }
    if (T > cir) {
      int now = 0;
      for (int i = len + 1; i <= len + n; i++) {
        a[i] = a[i - n];
        f[i] = 1;
        for (int j = i - n; j < i; j++)
          if (a[j] <= a[i]) gmax(f[i], f[j] + 1);
        gmax(now, f[i]);
      }
      int dif = now - ans;
      ans += (T - cir) * dif;
    }
    printf("%d\n", ans);
  }
  return 0;
}
