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.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStreamReader;
import java.io.IOException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author AlexFetisov
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB_CF323 solver = new TaskB_CF323();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB_CF323 {
        public static final long INF = (long) 1e9;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int T = in.nextInt();
            int[] a = Utils.readIntArray(in, n);
            long[][] mat = new long[n][n];
            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < n; ++j) {
                    if (a[j] >= a[i]) {
                        mat[i][j] = 1;
                        for (int k = 0; k < j; ++k) {
                            if (a[k] <= a[j]) {
                                mat[i][j] = Math.max(mat[i][j], mat[i][k] + 1);
                            }
                        }
                    } else {
                        mat[i][j] = -INF;
                    }
                }
            }
            mat = pow(mat, T);
            long result = 0;
            for (int i = 0; i < n; ++i) {
                result = Math.max(IntegerUtils.max(mat[i]), result);
            }
            out.println(result);
        }

        private long[][] pow(long[][] mat, int pow) {
            long[][] res = new long[mat.length][mat.length];
            for (int i = pow; i != 0; i >>= 1) {
                if (BitUtils.checkBit(i, 0)) {
                    res = mul(res, mat);
                }
                mat = mul(mat, mat);
            }
            return res;
        }

        private long[][] mul(long[][] a, long[][] b) {
            long[][] res = new long[a.length][b.length];
            for (int i = 0; i < a.length; ++i) {
                for (int j = 0; j < a.length; ++j) {
                    res[i][j] = -INF;
                    for (int k = 0; k < a.length; ++k) {
                        res[i][j] = Math.max(res[i][j], a[i][k] + b[k][j]);
                    }
                }
            }
            return res;
        }

    }

    static class BitUtils {
        public static boolean checkBit(int mask, int bit) {
            return (mask & (1 << bit)) > 0;
        }

    }

    static class IntegerUtils {
        public static long max(long... a) {
            long result = a[0];
            for (int i = 1; i < a.length; ++i) {
                result = Math.max(result, a[i]);
            }
            return result;
        }

    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer stt;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public String nextString() {
            while (stt == null || !stt.hasMoreTokens()) {
                stt = new StringTokenizer(nextLine());
            }
            return stt.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

    }

    static class Utils {
        public static int[] readIntArray(InputReader in, int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; ++i) {
                a[i] = in.nextInt();
            }
            return a;
        }

    }
}
