#include <bits/stdc++.h>
using namespace std;
const int inf = 800 * 1000 * 1000;
const long long mod = 1000 * 1000 * 1000 + 7;
const int num = 1000 * 1000 + 7;
const int N = 1500 + 7;
const long double PI = acos(-1.0);
int b[307];
int r[307];
int d[307][307];
int n;
struct M {
  int a[307][307];
  M() {
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j) a[i][j] = 0;
  }
  M(int e) {
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= n; ++j) {
        if (b[j] >= b[i]) {
          a[i][j] = 1;
          for (int k = 1; k < j; ++k) {
            if (b[k] <= b[j]) {
              a[i][j] = max(a[i][j], 1 + a[i][k]);
            }
          }
        } else
          a[i][j] = -inf;
      }
  }
  M operator*(const M &cur) {
    M ans;
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= n; ++j) {
        ans.a[i][j] = -inf;
        for (int k = 1; k <= n; ++k)
          ans.a[i][j] = max(ans.a[i][j], a[i][k] + cur.a[k][j]);
      }
    }
    return ans;
  }
};
M binpow(int t) {
  if (t == 1) return M(1);
  if (t % 2 == 0) {
    M uf = binpow(t / 2);
    return uf * uf;
  } else
    return binpow(t - 1) * M(1);
}
int main() {
  int t;
  cin >> n >> t;
  for (int i = 1; i <= n; ++i) cin >> b[i];
  M e = binpow(t);
  int len = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) {
      len = max(len, e.a[i][j]);
    }
  cout << len << endl;
  return 0;
}
