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 MX = 100;
const int INF = 1e9;
int n, T;
int a[MX] = {0};
vector<vector<int> > fill(int n, int v) {
  vector<vector<int> > r;
  r.resize(n);
  for (int i = 0; i < n; i++) {
    r[i].assign(n, v);
  }
  return r;
}
vector<vector<int> > mul(vector<vector<int> > a, vector<vector<int> > b) {
  vector<vector<int> > r = fill(n, -INF);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int k = 0; k < n; k++) {
        r[i][j] = max(r[i][j], a[i][k] + b[k][j]);
      }
    }
  }
  return r;
}
vector<vector<int> > bp(vector<vector<int> > b, int p) {
  vector<vector<int> > r = fill(n, 0);
  while (p) {
    if (p & 1) r = mul(r, b);
    b = mul(b, b);
    p >>= 1;
  }
  return r;
}
int main() {
  scanf("%d%d", &n, &T);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  vector<vector<int> > d = fill(n, -INF);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i] > a[j]) continue;
      d[i][j] = 1;
      for (int k = 0; k < j; k++)
        if (a[j] >= a[k]) d[i][j] = max(d[i][j], d[i][k] + 1);
    }
  }
  d = bp(d, T);
  int ans = -1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      ans = max(ans, d[i][j]);
    }
  }
  printf("%d", ans);
  return 0;
}
