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;
#pragma comment(linker, "/STACK:16777216")
const double EPS = 1e-5;
const int INF = INT_MAX;
const long long MOD = 1e18;
const long double PI = atan2((long double)0, (long double)-1);
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
void solveС() {
  int n;
  cin >> n;
  vector<int> a(n * n);
  map<int, int> m;
  for (int i = 0; i < n * n; ++i) {
    cin >> a[i];
    m[a[i]]++;
  }
  set<int> s;
  for (int i = 0; i < n * n; ++i) {
    if (s.find(a[i]) == s.end())
      s.insert(a[i]);
    else
      s.erase(a[i]);
  }
  vector<int> b(s.begin(), s.end());
  for (int i = 0; i < b.size(); ++i)
    for (int j = 0; j < b.size(); ++j) m[gcd(b[i], b[j])]--;
  for (map<int, int>::iterator iter = m.begin(); iter != m.end(); ++iter)
    if (iter->second > 0) {
      int k = 1;
      while (k * k < iter->second) k++;
      for (int j = 0; j < k; ++j) b.push_back(iter->first);
    }
  for (int i = 0; i < b.size(); ++i) cout << b[i] << ' ';
}
void solveD() {
  int n, t;
  cin >> n >> t;
  int nn = n * n;
  vector<int> a(2 * nn);
  map<int, int> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    for (int j = i + n; j < 2 * nn; j += n) a[j] = a[i];
    m[a[i]]++;
  }
  vector<int> d(2 * nn);
  d[0] = 1;
  int bestRes = 0;
  for (int i = 1; i < 2 * nn; ++i) {
    d[i] = 1;
    ;
    for (int j = max(i - n, 0); j < i; ++j)
      if (a[j] <= a[i]) d[i] = max(d[i], d[j] + 1);
  }
  vector<int> rd(nn);
  rd[nn - 1] = 1;
  for (int i = nn - 1; i >= 0; --i) {
    rd[i] = 1;
    for (int j = min(nn - 1, i + n); j > i; --j)
      if (a[j] >= a[i]) rd[i] = max(rd[i], rd[j] + 1);
  }
  if (t <= 2 * n) {
    for (int i = 0; i < t * n; ++i) bestRes = max(bestRes, d[i]);
  } else {
    for (int i = 0; i < n; ++i) {
      int curRes = d[nn - n + i] + rd[i] + m[a[i]] * (t - 2 * n + 1) - 1;
      bestRes = max(bestRes, curRes);
    }
  }
  cout << bestRes << endl;
}
int main() {
  solveD();
  return 0;
}
