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;
const int maxn = 300 + 10;
const int maxm = maxn * 4 + 10;
const int inf = 1e8;
const long long mod = 1e9 + 7;
int getint() {
  char c;
  while ((c = getchar()) && !(c >= '0' && c <= '9') && c != '-')
    ;
  int ret = c - '0', sgn = 0;
  if (c == '-') sgn = 1, ret = 0;
  while ((c = getchar()) && c >= '0' && c <= '9') ret = ret * 10 + c - '0';
  if (sgn) ret = -ret;
  return ret;
}
const int limit = 100;
int dp[limit * 100 + 10], a[maxn], cnt[maxn];
int main() {
  int n, t;
  while (scanf("%d%d", &n, &t) == 2) {
    int i;
    for (i = 1; i <= n; i++) a[i] = getint();
    int ans = 0;
    if (t <= limit) {
      for (int k = 1; k <= t; k++) {
        for (int i = 1; i <= n; i++) {
          int temp = (k - 1) * n + i;
          dp[temp] = 1;
          for (int j = 1; j < temp; j++) {
            if (a[(j - 1) % n + 1] <= a[(temp - 1) % n + 1]) {
              dp[temp] = max(dp[temp], dp[j] + 1);
            }
          }
          ans = max(ans, dp[temp]);
        }
      }
      cout << ans << endl;
    } else {
      for (int k = 1; k <= 100; k++) {
        for (int i = 1; i <= n; i++) {
          int temp = (k - 1) * n + i;
          dp[temp] = 1;
          for (int j = 1; j < temp; j++) {
            if (a[(j - 1) % n + 1] <= a[(temp - 1) % n + 1]) {
              dp[temp] = max(dp[temp], dp[j] + 1);
            }
          }
          ans = max(ans, dp[temp]);
        }
      }
      memset(cnt, 0, sizeof(cnt));
      int tot = 1;
      for (int i = 1; i <= n; i++) {
        cnt[a[i]]++;
      }
      for (int i = 1; i <= n; i++) {
        if (cnt[a[i]] > tot) tot = cnt[a[i]];
      }
      ans = ans + (t - 100) * tot;
      cout << ans << endl;
    }
  }
  return 0;
}
