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;
int tr[1024] = {};
int M;
void init_tree(int n) {
  M = 1;
  while (M < n + 2) M <<= 1;
}
void change(int pos, int v) {
  pos += M;
  tr[pos] = v;
  pos >>= 1;
  while (pos) {
    tr[pos] = max(tr[pos << 1], tr[(pos << 1) | 1]);
    pos >>= 1;
  }
}
int get(int l, int r) {
  int res = 0;
  for (l += M - 1, r += M + 1; l ^ r ^ 1; l >>= 1, r >>= 1) {
    if (~l & 1) res = max(res, tr[l ^ 1]);
    if (r & 1) res = max(res, tr[r ^ 1]);
  }
  return res;
}
int a[305];
int cnt[305] = {};
void solve() {
  int n, T;
  cin >> n >> T;
  init_tree(300);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  int t = min(n, T);
  for (int j = 0; j < t; ++j)
    for (int i = 0; i < n; ++i) {
      int s = get(1, a[i]) + 1;
      change(a[i], s);
    }
  for (int i = 0; i < n; ++i) cnt[a[i]]++;
  int mx = 0;
  for (int i = 1; i <= 300; ++i) mx = max(mx, cnt[i]);
  cout << get(1, 300) + (T - t) * mx << endl;
}
int main() {
  solve();
  return 0;
}
