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;
namespace task {
const int N = 100;
const int M = 300;
int n, t, x, d;
int dp[2][M];
int a[N];
int main() {
  cin >> n >> t;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    --a[i];
  }
  for (int k = 0; k < min(N, t); ++k) {
    copy(dp[1], dp[1] + M, dp[0]);
    for (int i = 0; i < n; ++i) {
      int x = dp[1][a[i]] + 1;
      for (int j = 0; j < a[i]; ++j) {
        x = max(x, dp[1][j] + 1);
      }
      dp[1][a[i]] = x;
    }
  }
  x = 0;
  d = 0;
  for (int j = 0; j < M; ++j) {
    x = max(x, dp[1][j]);
    d = max(d, dp[0][j]);
  }
  d = x - d;
  if (t > N) {
    cout << x + (t - N) * d << '\n';
  } else {
    cout << x << '\n';
  }
  return 0;
}
}  // namespace task
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(11);
  cout.setf(ios::fixed);
  return task::main();
}
