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 long long INF = 1e15;
const int MAXN = 120;
int n;
void zero(long long a[MAXN][MAXN]) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) a[i][j] = 0;
}
void copy(const long long a[MAXN][MAXN], long long b[MAXN][MAXN]) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) b[i][j] = a[i][j];
}
void mult(long long a[MAXN][MAXN], long long b[MAXN][MAXN],
          long long c[MAXN][MAXN]) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      c[i][j] = -INF;
      for (int s = 0; s < n; s++) c[i][j] = max(c[i][j], a[i][s] + b[s][j]);
    }
}
long long buf[MAXN][MAXN], t[MAXN][MAXN];
long long b[MAXN][MAXN];
void binpow(const long long a[MAXN][MAXN], long long c[MAXN][MAXN],
            long long b) {
  copy(a, t);
  zero(c);
  while (b) {
    if (b & 1) {
      mult(c, t, buf);
      copy(buf, c);
    }
    mult(t, t, buf);
    copy(buf, t);
    b >>= 1;
  }
}
int main() {
  int T;
  scanf("%d %d", &n, &T);
  vector<long long> a(n);
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  long long mt[MAXN][MAXN];
  memset(mt, 0, sizeof(mt));
  for (int i = 0; i < MAXN; i++) mt[i][i] = 1;
  for (int s = 0; s < n; ++s) {
    for (int i = 0; i < n; ++i) {
      if (a[i] < a[s]) {
        mt[s][i] = -INF;
      } else {
        mt[s][i] = 1;
        for (int j = 0; j < i; ++j)
          if (a[j] <= a[i]) mt[s][i] = max(mt[s][i], mt[s][j] + 1);
      }
    }
  }
  binpow(mt, b, T);
  long long ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) ans = max(ans, b[i][j]);
  cout << ans << endl;
  return 0;
}
