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 MOD = int(1e9) + 7;
int debug = 1;
const int N = int(1e5) + 5;
using namespace std;
int a[105];
const int M = 305;
int g[M][M], dp1[M][M], dp2[M][M], freq[M];
int n;
int dp[105];
int calc(int x, int y) {
  int ans = 0;
  int i, j;
  memset(dp, 0, sizeof(dp));
  for (i = 0; i < n; i++) {
    if (a[i] < x || a[i] > y) continue;
    int val = 0;
    for (j = 0; j < i; j++)
      if (a[j] >= x && a[j] <= y && a[j] <= a[i]) val = max(val, dp[j]);
    dp[i] = val + 1;
    ans = max(ans, dp[i]);
  }
  return ans;
}
int main() {
  int i, j, k, t;
  ios::sync_with_stdio(false);
  cin >> n >> t;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    freq[a[i]]++;
  }
  for (i = 1; i < M; i++) {
    for (j = i; j < M; j++) {
      if (!freq[i] || !freq[j]) continue;
      g[i][j] = calc(i, j);
    }
  }
  for (j = 1; j <= n; j++) {
    for (i = 1; i < M; i++) {
      for (k = 1; k <= i; k++)
        dp1[i][j] = max(dp1[i][j], dp1[k][j - 1] + g[k][i]);
      for (k = i; k < M; k++)
        dp2[i][j] = max(dp2[i][j], dp2[k][j - 1] + g[i][k]);
    }
  }
  int ans = 0;
  for (i = 1; i < M; i++) {
    for (j = 0; j <= n; j++) {
      for (k = 0; k <= n; k++) {
        int len = t - j - k;
        if (len < 0) continue;
        ans = max(ans, dp1[i][j] + dp2[i][k] + len * freq[i]);
      }
    }
  }
  cout << ans;
}
