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 num[1111];
int dp[1111111];
int a[1111111];
int find(int l, int r, int x) {
  int res = 1;
  for (int i = l; i <= r; ++i) {
    if (a[i] <= x) {
      res = max(res, dp[i] + 1);
    }
  }
  return res;
}
void solve() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, T;
  cin >> n >> T;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    num[a[i]]++;
  }
  if (T <= 600) {
    int res = 0;
    for (int i = 0; i < n * T; ++i) {
      a[i] = a[i % n];
      dp[i] = find(max(0, i - n), i - 1, a[i]);
      res = max(res, dp[i]);
    }
    cout << res << endl;
    return;
  }
  int rep = 200;
  for (int i = 0; i < n * rep; ++i) {
    a[i] = a[i % n];
    dp[i] = find(max(0, i - n), i - 1, a[i]);
  }
  for (int i = n * (rep - 1); i < n * rep; ++i) {
    dp[i - n * (rep - 1)] = dp[i];
  }
  for (int i = 0; i < n; ++i) {
    dp[i] = dp[i] + num[a[i]] * (T - (2 * rep - 1));
  }
  int res = 0;
  for (int i = n; i < n * rep; ++i) {
    dp[i] = find(max(0, i - n), i - 1, a[i]);
    res = max(res, dp[i]);
  }
  cout << res << endl;
}
int main() {
  solve();
  return 0;
}
