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;
int N, T, ans;
int a[110], f[110], ff[110];
int b[110][110], bb[110][110];
int main() {
  scanf("%d%d", &N, &T);
  T--;
  for (int i = 1; i <= N; i++) scanf("%d", &a[i]);
  memset(ff, 200, sizeof(ff));
  memset(b, 200, sizeof(b));
  for (int head = 1; head <= N; head++) {
    memset(f, 200, sizeof(f));
    f[head] = 1;
    for (int i = head + 1; i <= N; i++)
      for (int j = head; j < i; j++)
        if (a[j] <= a[i]) f[i] = max(f[i], f[j] + 1);
    for (int i = head; i <= N; i++) ff[i] = max(ff[i], f[i]);
    for (int tail = 1; tail <= N; tail++)
      if (a[tail] <= a[head])
        for (int i = head; i <= N; i++) b[tail][i] = max(b[tail][i], f[i]);
  }
  memcpy(f, ff, sizeof(f));
  for (; T; T >>= 1) {
    if (T & 1) {
      memset(ff, 200, sizeof(ff));
      for (int i = 1; i <= N; i++)
        for (int j = 1; j <= N; j++) ff[j] = max(ff[j], f[i] + b[i][j]);
      memcpy(f, ff, sizeof(f));
    }
    memset(bb, 200, sizeof(bb));
    for (int i = 1; i <= N; i++)
      for (int j = 1; j <= N; j++)
        for (int k = 1; k <= N; k++)
          bb[i][j] = max(bb[i][j], b[i][k] + b[k][j]);
    memcpy(b, bb, sizeof(b));
  }
  ans = 0;
  for (int i = 1; i <= N; i++) ans = max(ans, f[i]);
  printf("%d", ans);
}
