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;
template <class T>
inline bool rd(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
template <class T>
inline void pt(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) pt(x / 10);
  putchar(x % 10 + '0');
}
const int mod = 1e9 + 7;
const int N = 1e5 + 3000;
const int M = 305;
long long m;
int n;
int a[N];
int cnt[M], pre[M], aft[M];
int dp[M];
int main() {
  rd(n);
  rd(m);
  int ma = 1;
  for (int i = 1; i <= n; i++) {
    rd(a[i]);
    cnt[a[i]]++;
    ma = max(ma, cnt[a[i]]);
  }
  int top = n + 1;
  m--;
  while (top + n <= 1e5 && m) {
    for (int i = 1; i <= n; i++) a[top++] = a[i];
    m--;
  }
  memset(dp, 0, sizeof dp);
  for (int j = 1; j < top; j++) {
    int tmp = 0;
    for (int k = 1; k <= a[j]; k++) tmp = max(tmp, dp[k]);
    dp[a[j]] = max(dp[a[j]], tmp + 1);
  }
  int ans = 0;
  for (int j = 1; j <= 300; j++) ans = max(ans, dp[j]);
  ans += ma * m;
  pt(ans);
  return 0;
}
