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>
using namespace std;
const int N = 100;
int n, m;
int mas[N], a[N];
int fmas[111];
int di[26][100];
int mat[26][N][N];
int T, nT;
int fun(int mn, int mx) {
  memset(fmas, 0, sizeof fmas);
  fmas[0] = -1;
  int en = 0;
  for (int i = 0; i < n; ++i) {
    if (mas[i] < mn || mas[i] > mx) continue;
    int l = 0, r = en, mid, ans = 0;
    int t = mas[i];
    while (l <= r) {
      mid = (l + r) >> 1;
      if (t >= fmas[mid]) {
        ans = mid;
        l = mid + 1;
      } else {
        r = mid - 1;
      }
    }
    fmas[ans + 1] = t;
    if (ans == en) {
      en++;
    }
  }
  return en;
}
void solve() {
  cin >> n >> T;
  for (int i = 0; i < n; ++i) {
    cin >> mas[i];
    a[i] = mas[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      mat[0][i][j] = fun(a[i], a[j]);
    }
  }
  for (int i = 1; (1 << i) <= T; ++i) {
    for (int j = 0; j < n; ++j) {
      for (int k = j; k < n; ++k) {
        for (int r = k; r < n; ++r) {
          mat[i][j][r] = max(mat[i][j][r], mat[i - 1][j][k] + mat[i - 1][k][r]);
        }
      }
    }
  }
  int cou = 0;
  for (int i = 25; i >= 0; --i) {
    if (T < (1 << i)) continue;
    T -= (1 << i);
    cou++;
    for (int j = 0; j < n; ++j) {
      for (int k = j; k < n; ++k) {
        di[cou][k] = max(di[cou][k], di[cou - 1][j] + mat[i][j][k]);
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) ans = max(ans, di[cou][i]);
  cout << ans << endl;
}
int main() {
  solve();
  return 0;
}
