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 MAXN = 2 * 1e4 + 10;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
int g[MAXN], a[MAXN];
int dp1[MAXN], dp2[MAXN];
int cnt[400];
int main() {
  int n, T;
  while (scanf("%d%d", &n, &T) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      g[i] = INF;
    }
    int ans = 0;
    if (T <= 2 * n) {
      for (int i = n + 1; i <= T * n; i++) {
        a[i] = a[i % n == 0 ? n : i % n];
        g[i] = INF;
      }
      for (int i = 1; i <= T * n; i++) {
        int k = upper_bound(g + 1, g + T * n + 1, a[i]) - g;
        dp1[i] = k;
        g[k] = min(g[k], a[i]);
        ans = max(ans, dp1[i]);
      }
      printf("%d\n", ans);
      continue;
    }
    for (int i = n + 1; i <= n * n; i++) {
      a[i] = a[i % n == 0 ? n : i % n];
      g[i] = INF;
    }
    for (int i = 1; i <= n * n; i++) {
      int k = upper_bound(g + 1, g + n * n + 1, a[i]) - g;
      dp1[i] = k;
      g[k] = min(g[k], a[i]);
    }
    memset(g, (INF), sizeof(g));
    for (int i = n * n; i >= 1; i--) {
      int k = upper_bound(g + 1, g + n * n + 1, -a[i]) - g;
      dp2[i] = k;
      g[k] = min(g[k], -a[i]);
    }
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if (a[i] <= a[j]) {
          int Max = 0;
          memset(cnt, (0), sizeof(cnt));
          for (int k = 1; k <= n; k++) {
            if (a[k] >= a[i] && a[k] <= a[j]) {
              cnt[a[k]]++;
            }
            Max = max(Max, cnt[a[k]]);
          }
          ans = max(ans, dp1[(n - 1) * n + i] + dp2[j] + Max * (T - 2 * n));
        }
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
