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;
long long poww(long long a, long long n) {
  if (n == 0) return 1LL;
  if (n == 1) return a % 1000000007;
  long long v = poww(a, n / 2);
  v = (v * v) % 1000000007;
  if (n % 2) {
    v = (v * a) % 1000000007;
  }
  return v;
}
long long n, t;
long long arr[100005];
long long A[1005];
long long BIT[305];
long long maxele[305];
long long read(long long x) {
  long long val = 0;
  for (; x >= 0; x -= (x & -x)) {
    val = max(val, BIT[x]);
    if (!x) break;
  }
  return val;
}
void upd(long long x, long long val) {
  for (; x <= 300; x += (x & -x)) {
    BIT[x] = max(BIT[x], val);
    if (!x) break;
  }
}
int main() {
  cin >> n >> t;
  long long idx = 0;
  long long valu = 0;
  for (long long i = 1; i <= n; ++i) {
    cin >> A[i];
    maxele[A[i]]++;
    if (valu < maxele[A[i]]) {
      valu = maxele[A[i]];
      idx = A[i];
    }
  }
  for (long long tt = 1; tt <= min(100LL, t); ++tt) {
    for (long long i = 1; i <= n; ++i) {
      arr[(tt - 1) * n + i] = A[i];
    }
  }
  long long tot = min(100LL, t) * n;
  long long rem = t - min(100LL, t);
  long long maxi = 0;
  for (long long i = 1; i <= tot; ++i) {
    long long val = read(arr[i]) + 1;
    maxi = max(maxi, val);
    upd(arr[i], val);
  }
  cout << maxi + rem * valu;
  return 0;
}
