#include <bits/stdc++.h>
using namespace std;
const int MX = 100;
const int INF = 1e9;
int n, T;
int a[MX] = {0};
vector<vector<int> > fill(int n, int v) {
  vector<vector<int> > r;
  r.resize(n);
  for (int i = 0; i < n; i++) {
    r[i].assign(n, v);
  }
  return r;
}
vector<vector<int> > mul(vector<vector<int> > a, vector<vector<int> > b) {
  vector<vector<int> > r = fill(n, -INF);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < n; k++) {
        r[i][j] = max(r[i][j], a[i][k] + b[k][j]);
      }
    }
  }
  return r;
}
vector<vector<int> > bp(vector<vector<int> > b, int p) {
  vector<vector<int> > r = fill(n, 0);
  while (p) {
    if (p & 1) r = mul(r, b);
    b = mul(b, b);
    p >>= 1;
  }
  return r;
}
int main() {
  scanf("%d%d", &n, &T);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  vector<vector<int> > d = fill(n, -INF);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i] > a[j]) continue;
      d[i][j] = 1;
      for (int k = 0; k < j; k++)
        if (a[j] >= a[k]) d[i][j] = max(d[i][j], d[i][k] + 1);
    }
  }
  d = bp(d, T);
  int ans = -1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      ans = max(ans, d[i][j]);
    }
  }
  printf("%d", ans);
  return 0;
}
