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 cnt[305];
vector<int> a, b, c;
int n, t;
int nn, nn2;
int dp[10005][305];
int dp2[10005][305];
int tmp;
int solve2(int idx, int bck) {
  if (idx == nn2) return 0;
  int &ret = dp2[idx][bck];
  if (ret != -1) return ret;
  if (c[idx] >= bck) ret = 1 + solve2(idx + 1, c[idx]);
  return ret = max(ret, solve2(idx + 1, bck));
}
int solve(int idx, int bck) {
  if (idx == nn) {
    return t * cnt[bck] + solve2(0, bck);
  }
  int &ret = dp[idx][bck];
  if (ret != -1) return ret;
  ret = 0;
  if (a[idx] >= bck) ret = 1 + solve(idx + 1, a[idx]);
  return ret = max(ret, solve(idx + 1, bck));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  memset(dp, -1, sizeof dp);
  memset(dp2, -1, sizeof dp2);
  cin >> n >> t;
  b.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    cnt[b[i]]++;
  }
  int i = 0;
  for (; i < min(100, t); i++) {
    for (int j = 0; j < n; j++) a.push_back(b[j]), nn++;
  }
  t -= i;
  tmp = min(i, t);
  t -= tmp;
  i = 0;
  for (; i < tmp; i++) {
    for (int j = 0; j < n; j++) c.push_back(b[j]), nn2++;
  }
  cout << solve(0, 0) << '\n';
  return 0;
}
