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 long long INF = 1 << 30;
const int N = 1e2;
int ar[1111111];
long long dp[1111111];
map<int, int> mpi;
int main() {
  int n, t, MAX = -1, cnt = 0;
  cin >> n >> t;
  int cnt2;
  int NUM_CNT = 300;
  if (t >= NUM_CNT) {
    cnt2 = NUM_CNT;
  } else
    cnt2 = t;
  t -= NUM_CNT;
  for (int i = 1; i <= N * NUM_CNT + 5; i++) {
    dp[i] = INF;
  }
  dp[0] = -INF;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
    mpi[ar[i]]++;
    MAX = max(MAX, mpi[ar[i]]);
  }
  for (int i = n; i < n * cnt2; i++) {
    ar[i] = ar[i - n];
  }
  for (int i = 0; i < n * cnt2; i++) {
    int j = int(upper_bound(dp, dp + cnt2 * n, ar[i]) - dp);
    if (dp[j - 1] <= ar[i] && ar[i] < dp[j]) {
      dp[j] = ar[i];
    }
  }
  long long ans = 0, temp = 0;
  for (int i = 1; i <= n * cnt2; i++) {
    if (dp[i] != INF) {
      temp = i;
    }
    ans = max(temp, ans);
  }
  if (t > 0) {
    ans += MAX * t;
  }
  cout << ans;
}
