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;
long long n, t, cnt[305];
vector<long long> a;
int solvebas(int sz) {
  vector<long long> v;
  vector<long long>::iterator it;
  for (int i = 1; i <= sz; i++) {
    it = upper_bound(v.begin(), v.end(), a[i]);
    if (it == v.end())
      v.push_back(a[i]);
    else
      *it = a[i];
  }
  return v.size();
}
int solve(long long num, long long sz) {
  long long res = 0;
  vector<long long> v;
  vector<long long>::iterator it;
  for (int i = 1; i <= sz; i++) {
    it = upper_bound(v.begin(), v.end(), a[i]);
    if (it == v.end()) {
      if (v.size())
        v.push_back(a[i]);
      else if (a[i] == num)
        v.push_back(a[i]);
    } else {
      if (*it == num) continue;
      *it = a[i];
    }
  }
  return v.size();
}
long long solve2(long long num, long long sz) {
  vector<long long> v;
  vector<long long>::iterator it;
  for (int i = sz; i >= 1; i--) {
    it = upper_bound(v.begin(), v.end(), -a[i]);
    if (it == v.end()) {
      if (v.size())
        v.push_back(-a[i]);
      else if (a[i] == num)
        v.push_back(-a[i]);
    } else {
      if (*it == -num) continue;
      *it = -a[i];
    }
  }
  return v.size();
}
long long soolve(long long num) {
  vector<long long> aa = a;
  long long in, dc, tmp, tmp2;
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j <= n; j++) a.push_back(a[j]);
  }
  in = solve(num, 100 * n);
  dc = solve2(num, 100 * n);
  tmp = (t - 200) * cnt[num];
  return in + dc + tmp;
}
int main() {
  cin >> n >> t;
  a.push_back(0);
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    cnt[x]++;
    a.push_back(x);
  }
  if (t <= 500) {
    long long sz = n * t;
    t--;
    int j = n + 1;
    while (t--) {
      for (int i = 1; i <= n; i++) a.push_back(a[i]);
    }
    cout << solvebas(sz) << "\n";
    return 0;
  }
  long long ans = 0;
  for (int i = 1; i <= 300; i++) {
    if (!cnt[i]) continue;
    ans = max(ans, soolve(i));
  }
  cout << ans << "\n";
  return 0;
}
