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;
long long int po(long long int x, long long int n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return po((x * x) % 1000000007, n / 2);
  else
    return (x * po((x * x) % 1000000007, (n - 1) / 2)) % 1000000007;
}
long long int GCD(long long int A, long long int B) {
  if (B == 0)
    return A;
  else
    return GCD(B, A % B);
}
long long int fi(int k, vector<int>& a, int i) {
  if (k < 0) return 0;
  if (i == a.size() - 1) {
    if (k <= a[i])
      return 1;
    else
      return 0;
  }
  long long int an = 0;
  for (int j = 0; j <= a[i]; ++j) an += fi(k - j, a, i + 1);
  return an;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  long long int n, T;
  cin >> n >> T;
  int b[n * n];
  long long int an = T;
  int f[301] = {0};
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
    f[b[i]]++;
  }
  if (T * n <= n * n) {
    for (int i = n; i < n * n; ++i) b[i] = b[i - n];
    int dp[n * n];
    dp[0] = 1;
    for (int i = 1; i < min(T * n, n * n); ++i) {
      dp[i] = 1;
      for (int j = 0; j < i; ++j)
        if (b[j] <= b[i]) dp[i] = max(dp[i], dp[j] + 1);
      an = max(an, (long long int)dp[i]);
    }
    cout << an;
    return 0;
  }
  for (int i = n; i < n * n; ++i) b[i] = b[i - n];
  int dp1[n * n];
  dp1[0] = 1;
  int dp2[n * n];
  dp2[n * n - 1] = 1;
  for (int i = n * n - 2; i >= 0; --i) {
    dp2[i] = 1;
    for (int j = i + 1; j < n * n; ++j)
      if (b[j] >= b[i]) dp2[i] = max(dp2[i], dp2[j] + 1);
  }
  int c = 1;
  for (int i = 1; i < n * n; ++i) {
    c++;
    dp1[i] = 1;
    for (int j = 0; j < i; ++j)
      if (b[j] <= b[i]) dp1[i] = max(dp1[i], dp1[j] + 1);
    int c1 = 0;
    int d1 = c / n + (c % n != 0);
    for (int j = n * n - 1; j > i; --j) {
      c1++;
      int d = T - c1 / n - (c1 % n != 0) + 1;
      long long int e = d - d1 - 1;
      if (b[j] >= b[i]) an = max(an, dp2[j] + dp1[i] + e * f[b[i]]);
    }
  }
  cout << an;
}
