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;
void read_file(bool outToFile = true) {}
int n, T;
vector<int> A;
vector<int> build(int b) {
  vector<int> ret(b * n);
  for (int i = 0; i < b; i++)
    for (int j = 0; j < n; j++) ret[i * n + j] = A[j];
  return ret;
}
vector<int> LIS(vector<int> B) {
  vector<int> ret(B.size());
  ret[0] = 1;
  int sz = B.size();
  for (int i = 1; i < sz; i++) {
    ret[i] = 1;
    for (int j = 0; j < i; j++)
      if (B[j] <= B[i]) ret[i] = max(ret[i], 1 + ret[j]);
  }
  return ret;
}
vector<int> LDS(vector<int> B) {
  int sz = B.size();
  vector<int> dp(sz);
  dp[sz - 1] = 1;
  for (int i = sz - 2; i >= 0; i--) {
    dp[i] = 1;
    for (int j = sz - 1; j > i; j--)
      if (B[i] <= B[j]) dp[i] = max(dp[i], 1 + dp[j]);
  }
  return dp;
}
void debug(vector<int> A) {
  int sz = A.size();
  for (int i = 0; i < sz; i++) cout << A[i] << " \n"[i == sz - 1];
}
int main() {
  read_file();
  while (scanf("%d%d", &n, &T) != EOF) {
    A.resize(n);
    for (int i = 0; i < n; i++) scanf("%d", &A[i]);
    if (T <= 2 * n) {
      A = build(T);
      A = LIS(A);
      int ans = *max_element(((A).begin()), ((A).end()));
      printf("%d\n", ans);
    } else {
      A = build(n);
      vector<int> L = LIS(A);
      vector<int> R = LDS(A);
      int ans = 0;
      for (int i = 0; i < n; i++) {
        int cnt = 0;
        for (int j = 0; j < n; j++) cnt += A[i] == A[j];
        for (int j = 0; j < n; j++) {
          if (A[i] > A[j]) continue;
          ans = max(ans, L[n * (n - 1) + i] + cnt * (T - 2 * n) + R[j]);
        }
      }
      printf("%d\n", ans);
    }
  }
}
