#include <bits/stdc++.h>
using namespace std;
inline int add(int a, int b, int m = 1000000007) {
  a += b;
  if (a >= m) a -= m;
  return a;
}
inline int mul(int a, int b, int m = 1000000007) {
  return (int)(((long long)a * (long long)b) % m);
}
inline int norm(int x, int m = 1000000007) {
  if (x >= m) x %= m;
  if (x < 0) x += m;
  return x;
}
inline int neg(int x, int m = 1000000007) {
  x = -x;
  return norm(x);
}
int n, t;
int a[305];
vector<vector<int> > matmul(vector<vector<int> > a, vector<vector<int> > b) {
  vector<vector<int> > c = a;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      c[i][j] = -1000000007;
      for (int k = 1; k <= n; ++k) {
        c[i][j] = max(c[i][j], a[i][k] + b[k][j]);
      }
    }
  }
  return c;
}
vector<vector<int> > po(vector<vector<int> > a, int x) {
  if (x == 1) return a;
  vector<vector<int> > temp = po(a, x / 2);
  temp = matmul(temp, temp);
  if (x & 1) temp = matmul(temp, a);
  return temp;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> t;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  vector<vector<int> > arr(n + 1);
  for (int i = 0; i <= n + 1 - 1; ++i) arr[i].resize(n + 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (a[j] < a[i])
        arr[i][j] = -1000000007;
      else {
        arr[i][j] = 1;
        for (int k = 1; k <= j - 1; ++k) {
          if (a[k] <= a[j]) arr[i][j] = max(arr[i][j], 1 + arr[i][k]);
        }
      }
    }
  }
  vector<vector<int> > x = po(arr, t);
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) ans = max(ans, x[i][j]);
  }
  cout << ans << endl;
  return 0;
}
