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, ck[301], fi[20010], se[20010];
vector<int> v, tmp;
int getLIS(int idx, int arr[]) {
  vector<int> L(tmp.size() + 1, 500);
  L[0] = -2e9;
  int len = -1;
  for (int i = 0; i <= idx; i++) {
    int pi = upper_bound(L.begin(), L.end(), tmp[i]) - L.begin();
    L[pi] = tmp[i];
    len = max(len, pi);
    arr[i] = pi;
  }
  return len;
}
int main() {
  scanf("%d%d", &n, &T);
  v = vector<int>(n);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]), ck[v[i]]++;
  if (T <= 2 * n) {
    for (int ite = 1; ite <= T; ite++) {
      tmp.insert(tmp.end(), v.begin(), v.end());
    }
    printf("%d\n", getLIS(tmp.size() - 1, fi));
  } else {
    for (int ite = 1; ite <= n; ite++) {
      tmp.insert(tmp.end(), v.begin(), v.end());
    }
    int maxi = -1;
    getLIS(tmp.size() - 1, fi);
    for (int i = 0; i < tmp.size(); i++) tmp[i] = -tmp[i];
    reverse(tmp.begin(), tmp.end());
    getLIS(tmp.size() - 1, se);
    reverse(se, se + tmp.size());
    for (int i = 0; i < v.size(); i++) {
      for (int j = 0; j < v.size(); j++) {
        if (v[i] <= v[j]) {
          maxi =
              max(maxi, fi[(n - 1) * n + i] + ck[v[i]] * (T - 2 * n) + se[j]);
        }
      }
    }
    printf("%d\n", maxi);
  }
}
