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 n, T, x;
vector<int> A, B;
vector<int> dp;
vector<int> res;
vector<int> fa;
int cnt[305];
int main() {
  scanf("%d%d", &n, &T);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    A.push_back(x);
    cnt[x]++;
  }
  if (n >= T) {
    for (int i = 0; i < T; i++)
      for (int j = 0; j < A.size(); j++) B.push_back(A[j]);
    dp.push_back(0);
    for (int i = 0; i < B.size(); i++) {
      x = upper_bound(dp.begin(), dp.end(), B[i]) - dp.begin();
      if (x == dp.size())
        dp.push_back(B[i]);
      else
        dp[x] = B[i];
    }
    cout << dp.size() - 1 << endl;
  } else if (n < T) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < A.size(); j++) B.push_back(A[j]);
    dp.push_back(0);
    fa.push_back(-1);
    for (int i = 0; i < B.size(); i++) {
      x = upper_bound(dp.begin(), dp.end(), B[i]) - dp.begin();
      if (x == dp.size())
        dp.push_back(B[i]);
      else
        dp[x] = B[i];
      res.push_back(dp.size() - 1);
      fa.push_back(fa[x - 1]);
    }
    int ans = dp.size() - 1;
    for (int i = 0; i < res.size(); i++) {
      int sa = i;
      int sb = fa[i + 1];
      if (sb != -1 && (sa / n == sb / n)) continue;
      for (int j = ((sb == -1) ? 1 : B[sb]); j <= B[sa]; j++) {
        ans = max(ans, (int)dp.size() - 1 + (T - n) * (cnt[j]));
      }
      if (res[i] == dp.size() - 1) {
        for (int j = B[i]; j <= 300; j++)
          ans = max(ans, (int)dp.size() - 1 + (T - n) * (cnt[j]));
      }
    }
    cout << ans << endl;
  }
  return 0;
}
