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.InputMismatchException;
import java.io.IOException;
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;
        FastInputReader in = new FastInputReader(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, FastInputReader in, PrintWriter out) {
            int n = in.nextInt();
            int T = in.nextInt();
            int t = Math.min(T, 1000);
            int[] a = new int[n * t];

            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }
            for (int i = n; i < n * t; i++) {
                a[i] = a[i - n];
            }
            int[][] tmp = new int[t][301];
            int[] s = lis(a, n, tmp);
            int ans = s.length;
            if (T <= 1000) {
                out.println(ans);
                return;
            }
            for (int i = 0; i < t - 1; i++) {
                boolean ok = true;
                int sum = 0;
                for (int j = 0; j <= 300; j++) {
                    if (tmp[i][j] != tmp[i + 1][j]) {
                        ok = false;
                    }
                    if (tmp[i][j] != 0) {
                        sum += tmp[i][j];
                    }
                }
                if (ok) {
                    T -= t;
                    ans += T * sum;
                    break;
                }
            }
            out.println(ans);
        }

        public int[] lis(int[] a, int k, int[][] tmp) {
            int n = a.length;
            int[] tail = new int[n];
            int[] prev = new int[n];

            int len = 0;
            for (int i = 0; i < n; i++) {
                int pos = lower_bound(a, tail, len, a[i]);
                len = Math.max(len, pos + 1);
                prev[i] = pos > 0 ? tail[pos - 1] : -1;
                tail[pos] = i;
            }

            int[] res = new int[len];
            for (int i = tail[len - 1]; i >= 0; i = prev[i]) {
                tmp[i / k][a[i]]++;
                res[--len] = a[i];
            }
            return res;
        }

        int lower_bound(int[] a, int[] tail, int len, int key) {
            int lo = -1;
            int hi = len;
            while (hi - lo > 1) {
                int mid = (lo + hi) >>> 1;
                if (a[tail[mid]] <= key) {
                    lo = mid;
                } else {
                    hi = mid;
                }
            }
            return hi;
        }

    }

    static class FastInputReader {
        static InputStream is;
        static private byte[] buffer;
        static private int lenbuf;
        static private int ptrbuf;

        public FastInputReader(InputStream stream) {
            is = stream;
            buffer = new byte[1024];
            lenbuf = 0;
            ptrbuf = 0;
        }

        private int readByte() {
            if (lenbuf == -1)
                throw new InputMismatchException();
            if (ptrbuf >= lenbuf) {
                ptrbuf = 0;
                try {
                    lenbuf = is.read(buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (lenbuf <= 0)
                    return -1;
            }
            return buffer[ptrbuf++];
        }

        public int nextInt() {
            int num = 0, b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
                ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = num * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

    }
}
