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;
struct edge {
  int u, v;
  long long w;
};
long long MOD = 1000000007;
long long _MOD = 1000000009;
double EPS = 1e-10;
int main() {
  int n, T;
  cin >> n >> T;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  if (T <= 1000) {
    int N = n * T;
    vector<int> A(N);
    for (int i = 0; i < N; i++) A[i] = a[i % n];
    vector<int> dp(301);
    for (int i = 0; i < N; i++) {
      int maxi = 0;
      for (int j = 1; j <= A[i]; j++) maxi = max(maxi, dp[j]);
      dp[A[i]] = maxi + 1;
    }
    int maxi = 0;
    for (int j = 1; j <= 300; j++) maxi = max(maxi, dp[j]);
    cout << maxi << endl;
  } else {
    int N = n * 300;
    vector<int> A(N);
    for (int i = 0; i < N; i++) A[i] = a[i % n];
    vector<int> dp(301);
    for (int i = 0; i < N; i++) {
      int maxi = 0;
      for (int j = 1; j <= A[i]; j++) maxi = max(maxi, dp[j]);
      dp[A[i]] = maxi + 1;
    }
    vector<int> _dp(301);
    for (int i = N - 1; i >= 0; i--) {
      int maxi = 0;
      for (int j = 300; j >= A[i]; j--) maxi = max(maxi, _dp[j]);
      _dp[A[i]] = maxi + 1;
    }
    vector<int> num(301);
    for (int i = 0; i < n; i++) num[a[i]]++;
    long long ans = 0;
    for (int x = 1; x <= 300; x++) {
      if (num[x] == 0) continue;
      long long sum = (long long)(T - 600) * num[x];
      int maxi = 0;
      for (int j = 1; j <= x; j++) maxi = max(maxi, dp[j]);
      sum += maxi;
      maxi = 0;
      for (int j = 300; j >= x; j--) maxi = max(maxi, _dp[j]);
      sum += maxi;
      ans = max(ans, sum);
    }
    cout << ans << endl;
  }
}
