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;
inline long long R() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
int a[105], dp[30005], ha[400];
int main() {
  int n = R(), t = R();
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i <= n * 102; i++) dp[i] = 1;
  if (t <= 100) {
    for (int i = 1; i <= t; i++)
      for (int j = 1; j <= n; j++)
        for (int k = 1; k < j + n * (i - 1); k++) {
          int x = k % n;
          if (x == 0) x = n;
          if (a[j] >= a[x])
            dp[j + n * (i - 1)] = max(dp[j + n * (i - 1)], dp[k] + 1);
        }
    int mm = -1;
    for (int i = 1; i <= n * t; i++) mm = max(dp[i], mm);
    cout << mm << endl;
  } else {
    for (int i = 1; i <= 100; i++)
      for (int j = 1; j <= n; j++)
        for (int k = 1; k < j + n * (i - 1); k++) {
          int x = k % n;
          if (x == 0) x = n;
          if (a[j] >= a[x])
            dp[j + n * (i - 1)] = max(dp[j + n * (i - 1)], dp[k] + 1);
        }
    int mm = -1, ans = 0;
    for (int i = 1; i <= n * 100; i++) mm = max(dp[i], mm);
    for (int i = 1; i <= n; i++) {
      ha[a[i]]++;
      if (ha[a[i]] > ans) ans = ha[a[i]];
    }
    cout << mm + (t - 100) * ans << endl;
  }
  return 0;
}
