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 main() {
  int n, t;
  cin >> n >> t;
  vector<int> a(100 * n);
  map<int, int> c;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    c[a[i]]++;
  }
  for (int i = 0; i < 99 * n; i++) a[i + n] = a[i];
  int d[100 * n], dd[100 * n];
  for (int i = 0; i < 100 * n; i++) {
    d[i] = 0;
    dd[i] = 0;
  }
  for (int i = 0; i < 100 * n; i++) {
    int m = 0;
    for (int j = 0; j < i; j++)
      if (a[j] <= a[i]) m = max(m, d[j] + 1);
    d[i] = max(1, m);
  }
  for (int i = 100 * n - 1; i >= 0; i--) {
    int m = 0;
    for (int j = 100 * n - 1; j > i; j--)
      if (a[j] >= a[i]) m = max(m, dd[j] + 1);
    dd[i] = max(1, m);
  }
  if (t < 100) {
    int ans = 0;
    for (int i = 0; i < t * n; i++) ans = max(ans, d[i]);
    cout << ans << endl;
    return 0;
  }
  int ans = 0;
  for (int i = 0; i < 100 * n; i++) {
    int anstmp = 0;
    anstmp += c[a[i]] * (t - 100);
    anstmp += dd[i] + d[i] - 1;
    ans = max(ans, anstmp);
  }
  cout << ans << endl;
  return 0;
}
