You are given an array of positive integers a1, a2, ..., an × T of length n × T. We know that for any i > n it is true that ai = ai - n. Find the length of the longest non-decreasing sequence of the given array.

Input

The first line contains two space-separated integers: n, T (1 ≤ n ≤ 100, 1 ≤ T ≤ 107). The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 300).

Output

Print a single number — the length of a sought sequence.

Examples

Input

4 3
3 1 4 2


Output

5

Note

The array given in the sample looks like that: 3, 1, 4, 2, 3, 1, 4, 2, 3, 1, 4, 2. The elements in bold form the largest non-decreasing subsequence. 
#include <bits/stdc++.h>
const int INF = 2147483647;
const int INF2 = 0x3f3f3f3f;
const long long INF64 = (long long)2e18;
const double INFD = 1e30;
const double EPS = 1e-9;
const double PI = std::acos(-1);
const int MOD = 1e9 + 7;
template <typename T>
inline T read() {
  T X = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
const int MAXN = 105;
const int MAXV = 1 << 20;
int n, m, k;
int dr[4] = {0, 1, 0, -1};
int dc[4] = {-1, 0, 1, 0};
int dr2[8] = {1, 1, 1, -1, -1, -1, 0, 0};
int dc2[8] = {1, 0, -1, 1, 0, -1, 1, -1};
int CASE = 1;
int A[MAXN];
template <typename T>
struct Matrix {
 public:
  T mat[MAXN][MAXN];
  int rows, cols;
  Matrix() {}
  Matrix(int rows, int cols) : rows(rows), cols(cols) {
    memset(mat, 0, sizeof(T) * rows * cols);
  }
  inline void clear() {
    for (int i = 0; i < rows; i++) {
      for (int j = 0; j < cols; j++) {
        mat[i][j] = 0;
      }
    }
  }
  void identity() {
    for (int i = 0; i < rows; i++) {
      mat[i][i] = 0;
    }
  }
  inline Matrix<T> multiply(const Matrix<T>& other) const {
    Matrix<T> ret(this->rows, other.cols);
    int n = other.rows;
    for (int i = 0; i < ret.rows; i++) {
      for (int j = 0; j < ret.cols; j++) {
        ret.mat[i][j] = -INF2;
        for (int k = 0; k < n; k++) {
          ret.mat[i][j] = std::max(ret.mat[i][j], mat[i][k] + other.mat[k][j]);
        }
      }
    }
    return ret;
  }
};
template <typename T>
Matrix<T> fastexp(Matrix<T> mat, long long pow) {
  Matrix<T> ans(mat.rows, mat.cols);
  ans.identity();
  while (pow > 0) {
    if (pow & 1) ans = ans.multiply(mat);
    pow >>= 1;
    mat = mat.multiply(mat);
  }
  return ans;
}
Matrix<int> M;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    A[i] = read<int>();
  }
  M.rows = n, M.cols = n;
  for (int s = 1; s <= n; s++) {
    for (int i = 1; i <= n; i++) {
      if (A[i] < A[s]) {
        M.mat[s - 1][i - 1] = -INF2;
        continue;
      }
      M.mat[s - 1][i - 1] = 1;
      for (int j = 1; j < i; j++) {
        if (A[j] <= A[i]) {
          M.mat[s - 1][i - 1] =
              std::max(M.mat[s - 1][i - 1], M.mat[s - 1][j - 1] + 1);
        }
      }
    }
  }
  M = fastexp(M, m);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      ans = std::max(ans, M.mat[i][j]);
    }
  }
  printf("%d\n", ans);
  return 0;
}
