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. 
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(in.readLine());
        int n = Integer.parseInt(st.nextToken());
        int t = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(in.readLine());
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(st.nextToken());
        }
        int len = n*602;
        int[] big = new int[len + 1];
        Arrays.fill(big, 1);
        for (int i = 1; i <= len; i++) {
            for (int j = Math.max(0,i-n-1); j < i; j++) {
                if (a[i%n] >= a[j%n]) {
                    big[i] = Math.max(big[i], big[j]+1);
                }
            }
        }
        if (t*n <= len) {
            long res = 0;
            for (int i = 0; i < t*n; i++) {
                res = Math.max(res, big[i]);
            }
            out.println(res);
            out.close();
            return;
        }
        int[] blocks = new int[602];
        for (int i = 0; i < 601; i++) {
            int start = i*n;
            int res = 0;
            for (int j = start; j < start+n; j++) {
                res = Math.max(res, big[j]);
            }
            blocks[i] = res;
        }
        int startLen = 0;
        int startRes = 0;
        int endLen = 0;
        int endRes = 0;
        int pattern = blocks[400]-blocks[399];
        for (int i = 0; i < 601; i++) {
            if (i != 0 && blocks[i]-blocks[i-1] == pattern) {
                break;
            }
            startLen++;
            startRes += blocks[i];
            if (i != 0) {
                startRes -= blocks[i-1];
            }
        }
        for (int i = 600; i >= 0; i--) {
            if (i != 0 && blocks[i]-blocks[i-1] == pattern) {
                break;
            }
            endLen++;
            endRes += blocks[i];
            if (i != 0) {
                endRes -= blocks[i-1];
            }
        }
        long middle = t-startLen-endLen;
        long res = middle*pattern + startRes + endRes;
        out.println(res);
        out.close();
    }

}
/*


 */
