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

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int T = in.nextInt();
            int A[] = new int[N];
            for (int i = 0; i < N; i++) A[i] = in.nextInt();

            int bLength = N * (N + 2);
            int B[] = new int[bLength];
            for (int i = 0; i < bLength; i++) {
                B[i] = A[i % N];
            }

            int lis[] = new int[bLength];
            Arrays.fill(lis, 1);
            int idx[] = new int[bLength];
            for (int i = 1; i < bLength; i++) {
                for (int j = 0; j < i; j++) {
                    if (B[i] >= B[j] && lis[i] < lis[j] + 1) {
                        lis[i] = lis[j] + 1;
                        idx[i] = j;
                    }
                }
            }

            int max = 0;
            for (int i = 0; i < bLength; i++) {
                if (max < lis[i]) {
                    max = lis[i];
                }
            }

            int max_ost = 0;
            for (int i = 0; i < bLength - N; i++) {
                if (max_ost < lis[i]) {
                    max_ost = lis[i];
                }
            }
            if (T <= N) {
                int max_norm = 0;
                for (int i = 0; i < (N * T); i++) {
                    if (max_norm < lis[i]) {
                        max_norm = lis[i];
                    }
                }
                out.println(max_norm);
            } else {
                int ans = max + (T - N - 2) * (max - max_ost);
                out.println(ans);
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}

