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

public class Main {

    static int n = 0, T = 0, count = 0;
    static int[] m = new int[110];

    static int[][] getZeroMatrix() {
        int[][] zeroMatrix = new int[count][count];
        for (int i = 0; i < count; i++) {
            for (int j = 0; j < count; j++) {
                zeroMatrix[i][j] = 0;
            }
        }
        return zeroMatrix;
    }

    static int[][] mul(int[][] matr, int n) {
        if (n == 0) {
            return getZeroMatrix();
        }
        else if (n == 1) {
            return matr;
        } else if (n == 2) {
            return getNextMatrix(matr, matr);
        } else if (n % 2 == 0) {
            int[][] temp = mul(matr, n / 2);
            return getNextMatrix(temp, temp);
        } else {
            return getNextMatrix(mul(matr, n - 1), matr);
        }
    }

    static int convert(int[] init) {
        int[] temp = new int[400];
        Arrays.fill(temp, 0);

        count = 0;
        for (int i = 0; i < n; i++) {
            int num = init[i];
            if (temp[num] == 0) {
                count++;
                temp[num] = 1;
            }
        }

        int cnt = 0;
        for (int i = 0; i < 400; i++) {
            if (temp[i] != 0) {
                temp[i] = cnt++;
            }
        }

        for (int i = 0; i < n; i++) {
            init[i] = temp[init[i]];
        }

        return count;
    }

    static int[][] createInitMatrix(int[] convertedInit) {
        int[][] initMatrix = getZeroMatrix();

        for (int i = 0; i < count; i++) {
            for (int j = 0; j < n; j++) {
                int num = convertedInit[j];
                if (num >= i) {
                    initMatrix[i][num]++;
                    for (int k = i; k < num; k++) {
                        if (initMatrix[i][k] + 1 > initMatrix[i][num]) {
                            initMatrix[i][num] = initMatrix[i][k] + 1;
                        }
                    }
                }
            }
        }

        return initMatrix;
    }

    static int[][] getNextMatrix(int[][] m1, int[][] m2) {
        int[][] nextMatrix = getZeroMatrix();

        for (int i = 0; i < count; i++) {
            for (int j = i; j < count; j++) {
                for (int k = i; k <= j; k++) {
                    for (int l = i + (k - i); l <= j; l++) {
                        int a = m1[i][k] + m2[l][j];
                        int b = m1[l][j] + m2[i][k];
                        if (Math.max(a, b) > nextMatrix[i][j]) {
                            nextMatrix[i][j] = a;
                        }
                    }
                }
            }
        }

        return nextMatrix;
    }

    static int findMax(int[][] matr) {
        int answ = 0;
        for (int i = 0; i < count; i++) {
            for (int j = 0; j < count; j++) {
                if (matr[i][j] > answ) {
                    answ = matr[i][j];
                }
            }
        }
        return answ;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        T = sc.nextInt();

        for (int i = 0; i < n; i++) {
            m[i] = sc.nextInt();
        }
        convert(m);
        int[][] initMatr = createInitMatrix(m);

        int[][] answ = mul(initMatr, T);

        System.out.println(findMax(answ));

    }
}
