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 MAXN = 40010;
const int INF = 0x3f3f3f3f;
int n;
int nn, tt;
int A[MAXN], S[MAXN];
int d[MAXN];
int times[400];
void init() {
  for (int i = 1; i <= n; i++) S[i] = INF;
  memset(d, 0, sizeof(d));
}
int BSearch(int x, int y, int v) {
  while (x <= y) {
    int mid = x + (y - x) / 2;
    if (S[mid] <= v)
      x = mid + 1;
    else
      y = mid - 1;
  }
  return x;
}
int dp() {
  init();
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int x = 1, y = i;
    int pos = BSearch(x, y, A[i]);
    d[i] = pos;
    S[d[i]] = min(S[d[i]], A[i]);
    ans = max(ans, d[i]);
  }
  return ans;
}
int main() {
  scanf("%d%d", &nn, &tt);
  if (tt <= nn) {
    n = nn * tt;
    for (int i = 1; i <= nn; i++) scanf("%d", &A[i]);
    for (int i = 2; i <= tt; i++)
      for (int j = 1; j <= nn; j++) A[(i - 1) * nn + j] = A[j];
    cout << dp();
  } else {
    n = nn * nn;
    for (int i = 1; i <= nn; i++) scanf("%d", &A[i]);
    for (int i = 2; i <= nn; i++)
      for (int j = 1; j <= nn; j++) A[(i - 1) * nn + j] = A[j];
    int ans1 = dp();
    memset(times, 0, sizeof(times));
    int max_times = 0;
    for (int i = 1; i <= nn; i++) times[A[i]]++;
    for (int i = 1; i <= 300; i++) max_times = max(max_times, times[i]);
    cout << (long long)ans1 + (long long)max_times * (long long)(tt - nn);
  }
  return 0;
}
