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>
const long double pi = acos(-1.0);
const long double eps = 1e-6;
using namespace std;
const int N = 100 * 100 + 10;
int n;
long long t;
long long a[N], dp[N];
long long cnt[N];
void solve() {
  cin >> n >> t;
  long long sz = min(n * 1ll, t);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
    for (int j = 1; j <= sz - 1; j++) a[i + j * n] = a[i];
  }
  long long kol = min(n * n * 1ll, n * t);
  dp[0] = 0;
  for (int i = 1; i <= kol; i++) {
    for (int j = 0; j < i; j++) {
      if (a[j] <= a[i]) dp[i] = max(dp[i], dp[j] + 1);
    }
  }
  long long mx = 0;
  for (int i = 1; i < N; i++) mx = max(mx, cnt[i]);
  long long ans = 0;
  for (int i = 1; i <= kol; i++) {
    ans = max(ans, dp[i]);
  }
  cout << ans + mx * (t - min(t, n * 1ll)) << endl;
}
int main() {
  ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0);
  cout.setf(ios::fixed), cout.precision(6);
  int step;
  step = 1;
  for (int i = 1; i <= step; i++) {
    solve();
  }
}
