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;
const int INF = numeric_limits<int>::max();
int n;
vector<int> d, a;
int get_longest(int l) {
  vector<int> d;
  while (l > a.size())
    for (int i = 0; i < n; ++i) a.push_back(a[i]);
  d.assign(l + 10, INF);
  d[0] = -INF;
  for (int i = 0; i < l; ++i) {
    int j = int(upper_bound(d.begin(), d.end(), a[i]) - d.begin());
    if (d[j - 1] <= a[i] && a[i] < d[j]) d[j] = a[i];
  }
  for (int i = 1; i <= l; ++i)
    if (d[i] == INF) return i - 1;
  return l;
}
int main() {
  int t;
  int longest_same = 1;
  vector<int> b;
  scanf("%d %d", &n, &t);
  a.assign(n, 0);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  b.assign(a.begin(), a.end());
  sort(b.begin(), b.end());
  map<int, int> new_val;
  int longest = 1;
  for (int i = 0; i < n; ++i) {
    if (i > 0 && b[i] == b[i - 1])
      ++longest;
    else {
      if (longest > longest_same) longest_same = longest;
      longest = 1;
    }
    if (i == 0 || b[i] != b[i - 1]) new_val[b[i]] = i;
  }
  if (longest > longest_same) longest_same = longest;
  for (int i = 0; i < n; ++i) {
  }
  longest = get_longest(n);
  int next_longest, prev_longest;
  int d = INF;
  int k = 1;
  while (d > longest_same && k < t) {
    ++k;
    next_longest = get_longest(k * n);
    d = next_longest - longest;
    prev_longest = longest;
    longest = next_longest;
  }
  if (d <= longest_same) {
    longest = prev_longest + (t - k + 1) * longest_same;
  }
  printf("%d\n", longest);
  return 0;
}
