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 n, t, a[10000], cnt[301], prv[301], ans;
int solve(int t, int m) {
  for (int i = 1; i <= 300; ++i) prv[i] = 0;
  for (int i = 0; i < n * min(n, t); ++i) {
    if (a[i] > m) continue;
    int x = 1;
    for (int j = a[i]; j; --j) x = max(x, prv[j] + 1);
    prv[a[i]] = max(x, prv[a[i]]);
  }
  int ans1 = 0;
  for (int i = 1; i <= 300; ++i) ans1 = max(ans1, prv[i]);
  t -= n;
  if (t <= 0) return ans1;
  for (int i = 1; i <= 300; ++i) prv[i] = 0;
  for (int i = 0; i < n * min(n, t); ++i) {
    if (a[i] < m) continue;
    int x = 1;
    for (int j = a[i]; j; --j) x = max(x, prv[j] + 1);
    prv[a[i]] = max(x, prv[a[i]]);
  }
  int ans2 = 0;
  for (int i = 1; i <= 300; ++i) ans2 = max(ans2, prv[i]);
  t -= n;
  if (t <= 0) return ans1 + ans2;
  return ans1 + ans2 + t * cnt[m];
}
int main() {
  cin >> n >> t;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    ++cnt[a[i]];
  }
  for (int i = n; i < n * n; ++i) a[i] = a[i - n];
  for (int i = 1; i <= 300; ++i)
    if (cnt[i]) ans = max(ans, solve(t, i));
  cout << ans << endl;
  return 0;
}
