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 N = 130;
int a[N], n, t, f[N][N], g[N][N], tmp[N], get_f[N][N], get_g[N][N];
int main() {
  cin >> n >> t;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  a[0] = 0;
  a[n + 1] = 10000;
  for (int i = 0; i <= n + 1; i++)
    for (int j = 0; j <= n + 1; j++) {
      get_f[i][j] = 0;
      for (int k = 1; k <= n; k++)
        if (a[k] >= a[i] && a[k] <= a[j]) {
          tmp[k] = 1;
          for (int p = 1; p < k; p++)
            if (a[p] >= a[i] && a[p] <= a[k]) tmp[k] = max(tmp[k], tmp[p] + 1);
          get_f[i][j] = max(get_f[i][j], tmp[k]);
        }
    }
  for (int i = 0; i <= n + 1; i++)
    for (int j = 0; j <= n + 1; j++) {
      get_g[i][j] = 0;
      for (int k = n; k >= 1; k--)
        if (a[k] >= a[i] && a[k] <= a[j]) {
          tmp[k] = 1;
          for (int p = k + 1; p <= n; p++)
            if (a[p] >= a[k] && a[p] <= a[j]) tmp[k] = max(tmp[k], tmp[p] + 1);
          get_g[i][j] = max(get_g[i][j], tmp[k]);
        }
    }
  for (int j = 0; j <= n + 1; j++) {
    f[0][j] = 0;
    g[0][j] = 0;
  }
  for (int i = 1; i <= n + 10; i++)
    for (int j = 0; j <= n + 1; j++) {
      f[i][j] = 0;
      for (int k = 0; k <= n + 1; k++)
        if (a[k] <= a[j]) {
          f[i][j] = max(f[i][j], f[i - 1][k] + get_f[k][j]);
        }
      g[i][j] = 0;
      for (int k = 0; k <= n + 1; k++)
        if (a[k] >= a[j]) {
          g[i][j] = max(g[i][j], g[i - 1][k] + get_g[j][k]);
        }
    }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int tmp = 0;
    for (int j = 1; j <= n; j++)
      if (a[j] == a[i]) tmp++;
    for (int j = 0; j <= n + 2; j++)
      for (int k = 0; k <= n + 2; k++)
        if (j + k <= t) {
          ans = max(ans, f[j][i] + g[k][i] + (t - j - k) * tmp);
        }
  }
  cout << ans << endl;
  return 0;
}
