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.FileReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.File;
import java.util.StringTokenizer;
import java.io.FileNotFoundException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Kartik Singal (ka4tik)
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(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, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            int t = in.nextInt();
            int a[] = new int[n];
            int[] counts = new int[301];
            for (int i = 0; i < a.length; i++) {
                a[i] = in.nextInt();
                counts[a[i]]++;
            }
            if (t <= 2 * n) {
                int b[] = new int[n * t];
                for (int i = 0; i < b.length; i++)
                    b[i] = a[i % a.length];
                out.println(lis(b));
            } else {

                int b[] = new int[n * n];
                for (int i = 0; i < b.length; i++)
                    b[i] = a[i % a.length];

                a = b;
                int[] prefix = new int[a.length];
                for (int i = 0; i < prefix.length; i++)
                    prefix[i] = 1;
                int[] maxPrefix = new int[301];
                for (int i = 0; i < a.length; i++) {
                    for (int j = 0; j < i; j++) {
                        if (a[i] >= a[j]) {
                            int k = prefix[j] + 1;
                            if (prefix[i] <= k) {
                                prefix[i] = k;
                            }
                        }
                    }
                    maxPrefix[a[i]] = Math.max(maxPrefix[a[i]], prefix[i]);
                }
                int[] suffix = new int[a.length];
                int[] maxSuffix = new int[301];
                for (int i = 0; i < suffix.length; i++)
                    suffix[i] = 1;
                for (int i = a.length - 1; i >= 0; i--) {
                    for (int j = a.length - 1; j > i; j--) {
                        if (a[i] <= a[j]) {
                            int k = suffix[j] + 1;
                            if (suffix[i] <= k) {
                                suffix[i] = k;
                            }
                        }
                    }
                    maxSuffix[a[i]] = Math.max(maxSuffix[a[i]], suffix[i]);

                }
                int ans = 1;
                for (int i = 1; i <= 300; i++)
                    ans = Math.max(ans, maxPrefix[i] + (t - 2 * n) * counts[i] + maxSuffix[i]);

                out.println(ans);
            }
        }

        private int lis(final int a[]) {
            int[] s = new int[a.length];
            for (int i = 0; i < s.length; i++)
                s[i] = 1;
            for (int i = 0; i < a.length; i++) {
                for (int j = 0; j < i; j++) {
                    if (a[i] >= a[j]) {
                        int k = s[j] + 1;
                        if (s[i] <= k) {
                            s[i] = k;
                        }
                    }
                }
            }
            int ans = s[0];
            for (int i = 0; i < a.length; i++) {
                if (s[i] >= ans)
                    ans = s[i];

            }
            return ans;

        }

    }

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

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

    }
}

