#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
int A[maxn];
int inf = 1e9;
int n;
void mul(int a[maxn][maxn], int b[maxn][maxn], int c[maxn][maxn]) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      c[i][j] = 0;
      for (int k = 0; k < n; k++) {
        if (i <= k && k <= j) {
          c[i][j] = max(c[i][j], a[i][k] + b[k][j]);
        }
      }
    }
  }
}
void pw(int a[maxn][maxn], int b, int res[maxn][maxn]) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      res[i][j] = 0;
    }
  }
  int tmp[maxn][maxn];
  while (b) {
    if (b & 1) {
      mul(a, res, tmp);
      memcpy(res, tmp, sizeof(tmp));
    }
    mul(a, a, tmp);
    memcpy(a, tmp, sizeof(tmp));
    b /= 2;
  }
}
int LIS(int l, int r) {
  int ls[n];
  ls[0] = inf;
  int ans = 0;
  int pos = 0;
  for (int i = 1; i < n; i++) {
    ls[i] = inf;
  }
  for (int i = 0; i < n; i++) {
    if (A[i] < l || A[i] > r) {
      continue;
    }
    pos = upper_bound(ls, ls + n, A[i]) - ls;
    ls[pos] = A[i];
    ans = max(ans, pos + 1);
  }
  return ans;
}
int main() {
  int t;
  cin >> n >> t;
  int res[maxn][maxn];
  vector<int> vec;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
    vec.push_back(A[i]);
  }
  sort(vec.begin(), vec.end());
  vec.resize(unique(vec.begin(), vec.end()) - vec.begin());
  for (int i = 0; i < n; i++) {
    A[i] = lower_bound(vec.begin(), vec.end(), A[i]) - vec.begin();
  }
  int mt[maxn][maxn];
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= n; j++) {
      mt[i][j] = LIS(i, j);
    }
  }
  pw(mt, t, res);
  cout << res[0][n - 1];
}
