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;
int a[10010];
map<int, int> calc;
int wow;
int LIS() {
  int len = 0;
  int d[10010];
  d[len] = -0x7fffffff;
  for (int i = 1; i <= wow; i++) {
    if (d[len] <= a[i])
      d[++len] = a[i];
    else {
      int mid = upper_bound(d + 1, d + 1 + len, a[i]) - d;
      d[mid] = a[i];
    }
  }
  return len;
}
int main() {
  cin >> n >> t;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (t < n) {
    for (int i = 1; i < t; i++)
      for (int j = 1; j <= n; j++) a[i * n + j] = a[j];
    wow = n * t;
    cout << LIS();
  } else {
    for (int i = 1; i < n; i++)
      for (int j = 1; j <= n; j++) a[i * n + j] = a[j];
    wow = n * n;
    int sth = LIS();
    int maxi = 0, num;
    for (int i = 1; i <= n; i++) calc[a[i]]++;
    for (map<int, int>::iterator i = calc.begin(); i != calc.end(); i++)
      maxi = max(maxi, i->second);
    cout << sth + maxi * (t - n);
  }
  return 0;
}
