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>
#pragma comment(linker, "/STACK:1677721600")
using namespace std;
const int mod = 1e9 + 7;
const double eps = 1e-8;
const double ee = exp(1.0);
const int inf = 0x3f3f3f3f;
const int maxn = 1e6 + 10;
const double pi = acos(-1.0);
const long long iinf = 0x3f3f3f3f3f3f3f3f;
int readT() {
  char c;
  int ret = 0, flg = 0;
  while (c = getchar(), (c < '0' || c > '9') && c != '-')
    ;
  if (c == '-')
    flg = 1;
  else
    ret = c ^ 48;
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c ^ 48);
  return flg ? -ret : ret;
}
long long readTL() {
  char c;
  int flg = 0;
  long long ret = 0;
  while (c = getchar(), (c < '0' || c > '9') && c != '-')
    ;
  if (c == '-')
    flg = 1;
  else
    ret = c ^ 48;
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c ^ 48);
  return flg ? -ret : ret;
}
int cnt[301];
int a[101];
int tmp[30001];
int len;
int binarySearch(int key) {
  if (len == 0 || tmp[len] <= key) {
    tmp[++len] = key;
  } else {
    int lo = upper_bound(tmp, tmp + len, key) - tmp;
    tmp[lo] = key;
  }
  return len;
}
int main() {
  int n = readT();
  int t = readT();
  memset(cnt, 0, sizeof(cnt));
  int maxCnt = 0;
  for (int i = (0); i <= (n - 1); i++) {
    a[i] = readT();
    cnt[a[i]]++;
    maxCnt = ((maxCnt) > (cnt[a[i]]) ? (maxCnt) : (cnt[a[i]]));
  }
  int m = ((t) < (300) ? (t) : (300));
  len = 0;
  for (int i = (0); i <= (m * n - 1); i++) {
    binarySearch(a[i % n]);
  }
  len += (t - m) * maxCnt;
  cout << len << endl;
  return 0;
}
