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.BufferedReader;
import java.util.Scanner;

/**
 * Created by pdhinwa on 03/10/15 AD.
 */
public class B {
    final static int MAXVAL = 300;

    private static class Matrix {
        int[][] mat;

        public Matrix(int n) {
            mat = new int[n][n];
        }

        public Matrix(int[][] mat) {
            this.mat = mat;
        }

        Matrix multiply(Matrix A, Matrix B) {
            int n = A.mat.length;
            Matrix C = new Matrix(n);
            int[] maxGoFrom = new int[n];
            for (int i = 0; i < n; i++) {
                for (int j = i; j < n; j++) {
                    int max = 0;
                    for (int k = j; k >= i; k--) {
                        max = Math.max(max, B.mat[k][j]);
                        maxGoFrom[k] = max;
                    }
                    for (int k = i; k <= j; k++) {
                        C.mat[i][j] = Math.max(C.mat[i][j], A.mat[i][k] + maxGoFrom[k]);
                    }
                }
            }
            return C;
        }

        Matrix expo(Matrix A, int power) {
            if (power == 1) {
                return A;
            } else if (power == 2) {
                return multiply(A, A);
            } else {
                if (!((power & 1) > 0)) {
                    Matrix res = expo(A, power / 2);
                    res = multiply(res, res);
                    return res;
                } else {
                    Matrix res = expo(A, power - 1);
                    res = multiply(res, A);
                    return res;
                }
            }
            /*
            int n = A.mat.length;
            Matrix res = new Matrix(n);
            for (int i = 0; i < n; i++)
                res.mat[i][i] = 0;
            while (power > 0) {
                if ((power & 1) > 0) {
                    res = multiply(res, A);
                }
                A = multiply(A, A);
                power >>= 1;
            }
            return res;
            */
        }

        public int findMax() {
            int ans = 0;
            for (int i = 0; i < mat.length; i++)
                for (int j = 0; j < mat.length; j++) {
                    ans = Math.max(ans, mat[i][j]);
                }
            return ans;
        }
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int T = scanner.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextInt();
        }
        int[][] valLis = getLis(a);
        /*
        for (int [] x: valLis) {
            for (int y : x) {
                System.out.print(y + " ");
            }
            System.out.println();
        }
        */
        int[][] lis = new int[MAXVAL + 1][MAXVAL + 1];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                lis[a[i]][a[j]] = Math.max(lis[a[i]][a[j]], valLis[i][j]);
            }
        }
        /*
        for (int [] x: lis) {
            for (int y : x) {
                System.out.print(y + " ");
            }
            System.out.println();
        }
        */
        Matrix A = new Matrix(lis);
        Matrix res = A.expo(A, T);
        int ans = res.findMax();
        System.out.println(ans);
    }

    private static int[][] getLis(int[] a) {
        int[][] lis = new int[a.length][a.length];
        for (int i = 0; i < a.length; i++) {
            for (int j = i; j < a.length; j++) {
                if (a[i] > a[j]) {
                    continue;
                }
                int toAdd = 1;
                if (i != j) {
                    toAdd = 2;
                }
                lis[i][j] = toAdd;
                for (int k = i + 1; k < j; k++) {
                    if (a[k] >= a[i] && a[k] <= a[j]) {
                        lis[i][j] = Math.max(lis[i][j], lis[i][k] + 1);
                    }
                }
            }
        }
        return lis;
    }
}
