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>
const int inf = 99999999;
using namespace std;
struct arry {
  int c[105][105];
};
int n, m;
arry add(arry a, arry b) {
  arry p;
  int i, j, k;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      p.c[i][j] = -inf;
      for (k = 1; k <= n; k++) {
        p.c[i][j] = max(p.c[i][j], a.c[i][k] + b.c[k][j]);
      }
    }
  }
  return p;
}
arry calpow(arry a, int pn) {
  arry tmp;
  int i, j;
  memset(tmp.c, 0, sizeof(tmp.c));
  tmp = a;
  while (pn) {
    if (pn & 1) tmp = add(tmp, a);
    a = add(a, a);
    pn >>= 1;
  }
  return tmp;
}
int main() {
  int i, j, num[105], s, k, t, T;
  arry st;
  while (~scanf("%d %d", &n, &T)) {
    for (i = 1; i <= n; i++) {
      scanf("%d", &num[i]);
    }
    memset(st.c, -1, sizeof(st.c));
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        if (num[i] > num[j])
          st.c[i][j] = -inf;
        else {
          st.c[i][j] = 1;
          for (k = 1; k < j; k++) {
            if (num[k] <= num[j]) {
              st.c[i][j] = max(st.c[i][j], st.c[i][k] + 1);
            }
          }
        }
      }
    }
    st = calpow(st, T - 1);
    int ans = -1;
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= n; j++) {
        ans = max(ans, st.c[i][j]);
      }
    }
    printf("%d\n", ans);
  }
}
