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 Vadim Semenov
 */
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 solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(final int testNumber, final InputReader in, final PrintWriter out) {
            final int max = 301;
            int n = in.nextInt();
            int t = in.nextInt();
            int[] a = in.nextIntArray(n);
            int[] prefix = new int[Math.min(n * n, n * t)];
            int[] suffix = new int[Math.min(n * n, n * t - prefix.length)];
            int[][] cnt = new int[max][n];
            cnt[a[0]][0]++;
            for (int i = 1; i < a.length; ++i) {
                for (int j = 0; j < max; ++j) {
                    cnt[j][i] = cnt[j][i - 1];
                }
                cnt[a[i]][i]++;
            }
            int[] fst = new int[max];
            for (int i = 0; i < prefix.length; ++i) {
                for (int val = 0; val <= a[i % n]; ++val) {
                    prefix[i] = Math.max(prefix[i], fst[val]);
                }
                ++prefix[i];
                fst[a[i % n]] = prefix[i];
            }
            int[] snd = new int[max];
            for (int i = suffix.length - 1; i >= 0; --i) {
                for (int val = a[i % n]; val < max; ++val) {
                    suffix[i] = Math.max(suffix[i], snd[val]);
                }
                ++suffix[i];
                snd[a[i % n]] = suffix[i];
            }
            int answer = 0;
            for (int i = 0; i < max; ++i) {
                for (int j = i; j < max; ++j) {
                    for (int k = j; k < max; ++k) {
                        answer = Math.max(answer, fst[i] + (t - (prefix.length + suffix.length) / n) * cnt[j][a
                                .length - 1] + snd[k]);
                    }
                }
            }
            out.println(answer);
        }

    }

    static class InputReader {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

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

        public int[] nextIntArray(int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; ++i) {
                array[i] = nextInt();
            }
            return array;
        }

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

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(readLine());
            }
            return tokenizer.nextToken();
        }

        public String readLine() {
            String line;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

    }
}

