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 long inf = 9223372036854775807ll;
const int iinf = 2147483647;
const int limit = 1048576;
using namespace std;
bool sync_with_stdio(bool sync = false);
int main() {
  int n, T;
  scanf("%d%d", &n, &T);
  vector<int> a(n + 1);
  for (int i = (int)1; i < (int)n + 1; i++) scanf("%d", &a[i]);
  vector<vector<int> > lis(301, vector<int>(301, 0));
  for (int i = (int)1; i < (int)301; i++) {
    vector<int> dp(301, 0);
    for (int j = (int)1; j < (int)n + 1; j++) {
      if (a[j] < i) continue;
      int t1 = dp[a[j]] + 1;
      for (int k = (int)a[j]; k < (int)301; k++) {
        dp[k] = max(dp[k], t1);
        lis[i][k] = max(lis[i][k], dp[k]);
      }
    }
  }
  vector<int> ans(301, 0);
  for (int i = (int)1; i < (int)min(1000, T) + 1; i++) {
    vector<int> new_ans(301, 0);
    for (int j = (int)1; j < (int)301; j++)
      for (int k = (int)1; k < (int)j + 1; k++)
        new_ans[j] = max(new_ans[j], ans[k] + lis[k][j]);
    swap(new_ans, ans);
  }
  if (T > 2000) {
    vector<int> new_ans(301, 0);
    for (int j = (int)1; j < (int)301; j++) {
      new_ans[j] = max(new_ans[j], ans[j] + (T - 2000) * lis[j][j]);
      for (int k = (int)1; k < (int)j; k++)
        new_ans[j] =
            max(new_ans[j], ans[k] + (T - 2001) * lis[k][k] + lis[k][j]);
    }
    swap(ans, new_ans);
  }
  for (int i = (int)1; i < (int)min(1000, T - 1000) + 1; i++) {
    vector<int> new_ans(301, 0);
    for (int j = (int)1; j < (int)301; j++)
      for (int k = (int)1; k < (int)j + 1; k++)
        new_ans[j] = max(new_ans[j], ans[k] + lis[k][j]);
    swap(new_ans, ans);
  }
  printf("%d", ans[300]);
  return 0;
}
