#include <bits/stdc++.h>
using namespace std;
long long n, t, d[110], dp[1010101], sz;
vector<long long> v;
int main() {
  scanf("%lld %lld", &n, &t);
  for (int i = 0; i < n; i++) scanf("%lld", &d[i]);
  while (sz < 10000) sz += n;
  for (int i = 0; i < sz; i++) {
    if (v.empty() || v.back() <= d[i % n])
      v.push_back(d[i % n]);
    else
      v[upper_bound(v.begin(), v.end(), d[i % n]) - v.begin()] = d[i % n];
    dp[i] = (long long)v.size();
  }
  if (n * t <= sz)
    printf("%lld", dp[n * t - 1]);
  else
    printf("%lld",
           dp[sz - 1] + (dp[sz - 1] - dp[sz - 1 - n]) * (n * t - sz) / n);
}
