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;
int a[101];
int dp[303][2];
int get(int i, bool p) {
  int ans = 0;
  for (; i > 0; i -= (i & (-i))) ans = max(dp[i][p], ans);
  return ans;
}
void upd(int i, int val, bool p) {
  for (; i < 301; i += (i & (-i))) dp[i][p] = max(dp[i][p], val);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, t, m;
  cin >> n >> t;
  for (int i = 0; i < n; i++) cin >> a[i];
  int sz = 100;
  m = min(sz, t);
  int b, c;
  for (int i = 0; i < n * m; i++) {
    b = a[i % n];
    dp[b][0] = get(b, 0);
    dp[b][0]++;
    upd(b, dp[b][0], 0);
  }
  for (int i = 0; i < n * (m + 1); i++) {
    c = a[i % n];
    dp[c][1] = get(c, 1);
    dp[c][1]++;
    upd(c, dp[c][1], 1);
  }
  if (t < sz)
    cout << get(300, 0);
  else {
    int dif = get(300, 1) - get(300, 0);
    cout << get(300, 0) + dif * (t - sz);
  }
  return 0;
}
