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 mod = (int)1e9;
const int inf = (int)2e9;
const int base = 1000 * 1000 * 1000;
const int maxn = 400;
const long double pi = acosl(-1.0);
const long double eps = 1e-9;
void error(void) { exit(1); }
inline long long maxf(long long a, long long b) { return (a >= b ? a : b); }
int main() {
  int n;
  long long t;
  scanf("%d %I64d", &n, &t);
  long long b[maxn] = {0};
  vector<long long> a(n);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
    b[a[i]]++;
  }
  if (t > 2 * n * n) {
    vector<long long> d(n * n);
    for (int i = 0; i < n; i++)
      for (int j = i; j < n * n; j += n) d[j] = a[i];
    vector<long long> dp(n * n, 1);
    for (int i = 1; i < (int)d.size(); i++)
      for (int j = max(0, i - n); j < i; j++) {
        if (d[j] <= d[i]) dp[i] = maxf(dp[i], dp[j] + 1);
      }
    vector<long long> dp2(n * n, 0);
    for (int i = 0; i < (int)d.size(); i++)
      for (int j = (int)d.size() - 2 * n; j < (int)d.size(); j++) {
        if (d[j] <= d[i]) {
          dp2[i] = maxf(dp2[i], dp[j] + b[d[i]] * (t - 2 * n) + 1);
        }
      }
    for (int i = 0; i < (int)d.size(); i++)
      for (int j = max(0, i - 2 * n); j < i; j++) {
        if (d[j] <= d[i]) {
          dp2[i] = maxf(dp2[i], dp2[j] + 1);
        }
      }
    for (int i = 0; i < (int)dp2.size(); i++) ans = max(ans, dp2[i]);
  } else {
    vector<long long> d(n * t);
    for (int i = 0; i < n; i++)
      for (int j = i; j < n * t; j += n) d[j] = a[i];
    vector<long long> dp(n * t, 1);
    for (int i = 1; i < (int)d.size(); i++)
      for (int j = max(0, i - n); j < i; j++) {
        if (d[j] <= d[i]) dp[i] = max(dp[i], dp[j] + 1);
      }
    for (int i = 0; i < (int)dp.size(); i++) ans = maxf(ans, dp[i]);
  }
  printf("%I64d", ans);
  return 0;
}
