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;
int a[105];
struct Fenwick_Tree {
  int sz, c[305];
  void init(int n) {
    sz = n;
    for (int i = 1; i <= n; i++) c[i] = 0;
  }
  int lowbit(int x) { return x & (-x); }
  void update(int p, int v) {
    for (int i = p; i <= sz; i += lowbit(i)) c[i] = max(c[i], v);
  }
  int query(int p) {
    int res = 0;
    for (int i = p; i > 0; i -= lowbit(i)) res = max(res, c[i]);
    return res;
  }
} BIT;
int b[200005], cnt[305];
int pre[305], suf[305];
int main() {
  int n, T;
  scanf("%d%d", &n, &T);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  if (T <= 2000) {
    for (int i = 0; i < T; i++)
      for (int j = 1; j <= n; j++) b[i * n + j] = a[j];
    int ans = 0;
    BIT.init(300);
    for (int i = 1; i <= n * T; i++) {
      int len = BIT.query(b[i]) + 1;
      BIT.update(b[i], len);
      ans = max(ans, len);
    }
    printf("%d\n", ans);
  } else {
    for (int i = 1; i <= n; i++) cnt[a[i]]++;
    for (int i = 0; i < 2000; i++)
      for (int j = 1; j <= n; j++) b[i * n + j] = a[j];
    BIT.init(300);
    for (int i = 1; i <= 1000 * n; i++) {
      pre[b[i]] = BIT.query(b[i]) + 1;
      BIT.update(b[i], pre[b[i]]);
    }
    BIT.init(300);
    for (int i = 2000 * n; i > 1000 * n; i--) {
      suf[b[i]] = BIT.query(301 - b[i]) + 1;
      BIT.update(301 - b[i], suf[b[i]]);
    }
    int ans = 0;
    for (int i = 1; i <= 300; i++)
      ans = max(ans, pre[i] + suf[i] + cnt[i] * (T - 2000));
    printf("%d\n", ans);
  }
  return 0;
}
