#include <bits/stdc++.h>
using namespace std;
inline long long gcd(long long x, long long y) { return x ? gcd(y % x, x) : y; }
const long long mod = 1e9 + 7;
inline long long QPow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return ans;
}
long long exgcd(long long a, long long b, long long &x, long long &y) {
  long long d = a;
  if (b == 0)
    x = 1, y = 0;
  else {
    d = exgcd(b, a % b, y, x), y -= a / b * x;
  }
  return d;
}
const long long maxn = 2e5 + 5;
const long long inf = mod;
struct matrix {
  long long m[101][101];
};
matrix b, ans;
long long arr[101];
long long len;
void init() {
  memset(b.m, 0, sizeof(b.m));
  for (long long i = 0; i < len; i++) {
    for (long long j = 0; j < len; j++) {
      if (arr[j] < arr[i])
        b.m[i][j] = -inf;
      else {
        b.m[i][j] = 1;
        for (long long k = 0; k < j; k++) {
          if (arr[k] <= arr[j]) b.m[i][j] = max(b.m[i][j], b.m[i][k] + 1);
        }
      }
    }
  }
}
matrix mul(matrix a, matrix b) {
  long long i, j, k;
  matrix c;
  for (i = 0; i < len; i++)
    for (j = 0; j < len; j++) {
      c.m[i][j] = -inf;
      for (k = 0; k < len; k++)
        c.m[i][j] = max(c.m[i][j], (a.m[i][k] + b.m[k][j]));
    }
  return c;
}
void mpow(matrix ma, long long n) {
  long long i;
  memset(ans.m, 0, sizeof(ans.m));
  for (i = 0; i < len; i++) ans.m[i][i] = 1;
  for (; n; n >>= 1) {
    if (n & 1) ans = mul(ans, ma);
    ma = mul(ma, ma);
  }
}
signed main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long t, k, n, T;
  cin >> n >> T;
  len = n;
  for (long long i = 0; i < n; i++) cin >> arr[i];
  init();
  mpow(b, T);
  long long Ans = -inf;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < n; j++) Ans = max(Ans, ans.m[i][j]);
  cout << Ans - 1 << endl;
  return 0;
}
