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 gcd(long long x, long long y) { return x ? gcd(y % x, x) : y; }
const long long mod = 1e9 + 7;
inline long long QPow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long exgcd(long long a, long long b, long long &x, long long &y) {
  long long d = a;
  if (b == 0)
    x = 1, y = 0;
  else {
    d = exgcd(b, a % b, y, x), y -= a / b * x;
  }
  return d;
}
const long long maxn = 2e5 + 5;
const long long inf = mod;
struct matrix {
  long long m[101][101];
};
matrix b, ans;
long long arr[101];
long long len;
void init() {
  memset(b.m, 0, sizeof(b.m));
  for (long long i = 0; i < len; i++) {
    for (long long j = 0; j < len; j++) {
      if (arr[j] < arr[i])
        b.m[i][j] = -inf;
      else {
        b.m[i][j] = 1;
        for (long long k = 0; k < j; k++) {
          if (arr[k] <= arr[j]) b.m[i][j] = max(b.m[i][j], b.m[i][k] + 1);
        }
      }
    }
  }
}
matrix mul(matrix a, matrix b) {
  long long i, j, k;
  matrix c;
  for (i = 0; i < len; i++)
    for (j = 0; j < len; j++) {
      c.m[i][j] = -inf;
      for (k = 0; k < len; k++)
        c.m[i][j] = max(c.m[i][j], (a.m[i][k] + b.m[k][j]));
    }
  return c;
}
void mpow(matrix ma, long long n) {
  long long i;
  memset(ans.m, 0, sizeof(ans.m));
  for (i = 0; i < len; i++) ans.m[i][i] = 1;
  for (; n; n >>= 1) {
    if (n & 1) ans = mul(ans, ma);
    ma = mul(ma, ma);
  }
}
signed main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long t, k, n, T;
  cin >> n >> T;
  len = n;
  for (long long i = 0; i < n; i++) cin >> arr[i];
  init();
  mpow(b, T);
  long long Ans = -inf;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) Ans = max(Ans, ans.m[i][j]);
  cout << Ans - 1 << endl;
  return 0;
}
