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

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

    static class TaskD {
        public void solve(int testNumber, Reader in, PrintWriter out) {
            int n = in.ni();
            int k = in.ni();
            int[] a = new int[n];
            Helper.fillIntArray(in, a);
            int[] buf = new int[301];
            Arrays.fill(buf, -1);
            for (int v : a) {
                ++buf[v];
            }
            int diffValues = 0;
            for (int i = 0, j = 0; i <= 300; i++) {
                if (buf[i] != -1) {
                    ++diffValues;
                    buf[i] = j++;
                }
            }
            int[] pos = new int[n];
            for (int i = 0; i < n; i++) {
                pos[i] = buf[a[i]];
            }
            int[][] dp = new int[diffValues][diffValues];
            int[] max = new int[diffValues];
            for (int i = 0; i < n; i++) {
                Arrays.fill(max, 0);
                for (int j = i; j < n; j++) {
                    if (a[j] < a[i]) {
                        continue;
                    }
                    int id = pos[j];
                    int prevMax = 0;
                    for (int z = id; z >= 0; z--) {
                        prevMax = Math.max(prevMax, max[z]);
                    }
                    dp[pos[i]][id] = Math.max(dp[pos[i]][id], prevMax + 1);
                    max[id] = prevMax + 1;
                }
            }
            int[][] p = new int[diffValues][diffValues];
            for (int i = 0; i < diffValues; i++) {
                p[i][i] = dp[i][i];
            }
            for (int i = 2; i <= diffValues; i++) {
                for (int j = 0; j <= diffValues - i; j++) {
                    p[j][i + j - 1] = Math.max(p[j][i + j - 2], Math.max(p[j + 1][i + j - 1], dp[j][i + j - 1]));
                }
            }
            dp = p;
            int[][][] levels = new int[7][n][n];
            levels[0] = dp;
            for (int i = 1; i < 7; i++) {
                levels[i] = get(levels[i - 1], diffValues);
            }
            int pow = 1_000_000;
            int[] prevRes = new int[diffValues];
            int[] res = new int[diffValues];
            for (int l = 6; l >= 0; l--) {
                dp = levels[l];
                while (k >= pow) {
                    for (int i = 0; i < diffValues; i++) {
                        for (int j = i; j < diffValues; j++) {
                            res[j] = Math.max(res[j], prevRes[i] + dp[i][j]);
                        }
                    }
                    for (int i = 0; i < diffValues; i++) {
                        prevRes[i] = res[i];
                        res[i] = 0;
                    }
                    k -= pow;
                }
                pow /= 10;
            }
            int ans = 0;
            for (int i = 0; i < diffValues; i++) {
                ans = Math.max(ans, prevRes[i]);
            }
            out.println(ans);
        }

        public int[][] get(int[][] dp, int n) {
            int[][] prev = new int[n][n];
            int[][] cur = new int[n][n];
            for (int t = 0; t < 10; t++) {
                for (int i = 0; i < n; i++) {
                    for (int j = i; j < n; j++) {
                        for (int z = i; z <= j; z++) {
                            cur[i][j] = Math.max(cur[i][j], prev[i][z] + dp[z][j]);
                        }
                    }
                }
                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < n; j++) {
                        prev[i][j] = cur[i][j];
                        cur[i][j] = 0;
                    }
                }
            }
            return prev;
        }

    }

    static class Helper {
        public static void fillIntArray(Reader in, int[] a) {
            for (int i = 0; i < a.length; i++) {
                a[i] = in.ni();
            }
        }

    }

    static class Reader {
        private BufferedReader in;
        private StringTokenizer st = new StringTokenizer("");
        private String delim = " ";

        public Reader(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
        }

        public String next() {
            if (!st.hasMoreTokens()) {
                st = new StringTokenizer(rl());
            }
            return st.nextToken(delim);
        }

        public String rl() {
            try {
                return in.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int ni() {
            return Integer.parseInt(next());
        }

    }
}

