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 MAXN = 201;
const int MAXQ = 305;
int a[2 * MAXN * MAXN];
int dp[2 * MAXN * MAXN];
int cnt_ma[MAXQ], cnt_ma_rev[MAXQ];
int cnt[MAXQ];
void solve(int *a, int len, int *cnt_ma) {
  for (int i = 0; i < MAXQ; i++) cnt_ma[i] = 0;
  for (int i = 0; i < len; i++) {
    dp[i] = 0;
    for (int j = 0; j <= a[i]; j++) {
      dp[i] = max(dp[i], cnt_ma[j]);
    }
    dp[i]++;
    cnt_ma[a[i]] = dp[i];
  }
}
void solve_rev(int *a, int len, int *cnt_ma) {
  for (int i = 0; i < MAXQ; i++) cnt_ma[i] = 0;
  for (int i = 0; i < len; i++) {
    dp[i] = 0;
    for (int j = a[i]; j < MAXQ; j++) {
      dp[i] = max(dp[i], cnt_ma[j]);
    }
    dp[i]++;
    cnt_ma[a[i]] = dp[i];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, t;
  cin >> n >> t;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int j = 1; j < 2 * n; j++) a[i + n * j] = a[i];
    cnt[a[i]]++;
  }
  if (t < 2 * n) {
    solve(a, t * n, cnt_ma);
    int ans = 0;
    for (int i = 0; i < n; i++) {
      ans = max(ans, cnt_ma[a[i]]);
    }
    cout << ans << endl;
    return 0;
  }
  solve(a, n * n, cnt_ma);
  reverse(a, a + n * n);
  solve_rev(a, n * n, cnt_ma_rev);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans = max(ans, cnt_ma[a[i]] + cnt_ma_rev[a[i]] + (t - 2 * n) * cnt[a[i]]);
  }
  cout << ans << endl;
  return 0;
}
