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 dx4[5] = {0, -1, 0, 1, 0};
const int dy4[5] = {0, 0, 1, 0, -1};
const int dx8[9] = {0, -1, 0, 1, 0, 1, 1, -1, -1};
const int dy8[9] = {0, 0, 1, 0, -1, 1, -1, 1, -1};
const int maxn = 1e5 + 5;
const double PI = acos(-1.0);
const long long mod = 1e9 + 7;
long long po(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  } else {
    return gcd(b % a, a);
  }
}
void YES() {
  puts("YES");
  exit(0);
}
void Yes() {
  puts("Yes");
  exit(0);
}
void NO() {
  puts("NO");
  exit(0);
}
void No() {
  puts("No");
  exit(0);
}
void one() {
  puts("-1");
  exit(0);
}
int n, T;
int maxx, cnt[maxn];
int val[maxn];
int lis[maxn];
int cal(int num) {
  int cnt = 1;
  lis[cnt] = val[1];
  for (int i = 2; i <= num; i++) {
    if (val[i] >= lis[cnt]) {
      cnt++;
      lis[cnt] = val[i];
    } else {
      int pos = upper_bound(lis + 1, lis + 1 + cnt, val[i]) - lis;
      lis[pos] = val[i];
    }
  }
  return cnt;
}
void solve() {
  scanf("%d", &(n)), scanf("%d", &(T));
  for (int i = 1; i <= n; i++) {
    scanf("%d", &(val[i]));
    cnt[val[i]]++;
    maxx = max(maxx, cnt[val[i]]);
  }
  for (int i = n + 1; i <= n * n; i++) {
    val[i] = val[i - n];
  }
  long long res = 0;
  if (T <= n) {
    res = cal(n * T);
  } else {
    res = cal(n * n) + 1LL * maxx * (T - n);
  }
  printf("%lld\n", res);
}
int main() {
  solve();
  return 0;
}
