#include <bits/stdc++.h>
using namespace std;
int n, T;
int num[110];
struct arry {
  int c[110][110];
};
struct arry mul(arry a, arry b) {
  int i, y, k;
  arry answer;
  for (i = 1; i <= n; i++)
    for (y = 1; y <= n; y++) {
      answer.c[i][y] = -99999999;
      for (k = 1; k <= n; k++) {
        answer.c[i][y] = max(answer.c[i][y], a.c[i][k] + b.c[k][y]);
      }
    }
  return answer;
}
struct arry calpow(arry a, int time) {
  arry b;
  b = a;
  while (time) {
    if (time & 1) {
      a = mul(a, b);
    }
    b = mul(b, b);
    time >>= 1;
  }
  return a;
}
int main() {
  int i, y, k;
  arry st;
  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 (y = 1; y <= n; y++) {
      if (num[i] > num[y])
        st.c[i][y] = -99999999;
      else {
        st.c[i][y] = 1;
        for (k = 1; k < y; k++) {
          if (num[k] <= num[y]) {
            st.c[i][y] = max(st.c[i][y], st.c[i][k] + 1);
          }
        }
      }
    }
  st = calpow(st, T - 1);
  int ans = -1;
  for (i = 1; i <= n; i++)
    for (y = 1; y <= n; y++) {
      ans = max(ans, st.c[i][y]);
    }
  printf("%d\n", ans);
  return 0;
}
