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.*;
import java.util.*;
import java.math.BigInteger;
import java.util.Map.Entry;

import static java.lang.Math.*;

public class B extends PrintWriter {

    class Num implements Comparable<Num> {
        Num prev;
        int val, block;

        public Num(Num prev, int val, int block) {
            this.prev = prev;
            this.val = val;
            this.block = block;
        }

        public int compareTo(Num n) {
            return Integer.compare(val, n.val);
        }

    }

    void run() {
        int n = nextInt(), m = nextInt();
        int k = min(2 * n + 1, m);

        int[] c = new int[301];

        int inf = 1000000000;

        int[] a = nextArray(n);

        if (n == 1) {
            println(m);
            return;
        }

        for (int i = 0; i < n; i++) {
            ++c[a[i]];
        }

        int[] b = new int[n * k];

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

        Num[] d = new Num[b.length + 1];

        Arrays.fill(d, new Num(null, inf, inf));

        d[0] = new Num(null, 0, -1);

        int ans = 0;

        for (int i = 0; i < b.length; i++) {

            for (int j = 0; j < d.length; j++) {
                if (b[i] < d[j].val) {
                    d[j] = new Num(d[j - 1], b[i], i / n);
                    ans = max(ans, j);
                    break;
                }
            }
        }

        for (int i = d.length - 1; i >= 0; i--) {
            if (d[i].val < inf) {

                Num cur = d[i];

                while (cur.prev != null) {

                    // println("    " + cur.val);

                    Num x = cur.prev;
                    Num y = cur;

                    if (x.val != 0 && x.block != y.block) {
                        int tmp = i + c[y.val] * (m - k);

                        ans = max(ans, tmp);
                    }

                    cur = cur.prev;
                }
                break;
            }
        }

        println(ans);

    }

    void skip() {
        while (hasNext()) {
            next();
        }
    }

    int[][] nextMatrix(int n, int m) {
        int[][] matrix = new int[n][m];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < m; j++)
                matrix[i][j] = nextInt();
        return matrix;
    }

    String next() {
        while (!tokenizer.hasMoreTokens())
            tokenizer = new StringTokenizer(nextLine());
        return tokenizer.nextToken();
    }

    boolean hasNext() {
        while (!tokenizer.hasMoreTokens()) {
            String line = nextLine();
            if (line == null) {
                return false;
            }
            tokenizer = new StringTokenizer(line);
        }
        return true;
    }

    int[] nextArray(int n) {
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = nextInt();
        }
        return array;
    }

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

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException err) {
            return null;
        }
    }

    public B(OutputStream outputStream) {
        super(outputStream);
    }

    static BufferedReader reader;
    static StringTokenizer tokenizer = new StringTokenizer("");
    static Random rnd = new Random();
    static boolean OJ;

    public static void main(String[] args) throws IOException {
        OJ = System.getProperty("ONLINE_JUDGE") != null;
        B solution = new B(System.out);
        if (OJ) {
            reader = new BufferedReader(new InputStreamReader(System.in));
            solution.run();
        } else {
            reader = new BufferedReader(new FileReader(new File(B.class.getName() + ".txt")));
            long timeout = System.currentTimeMillis();
            while (solution.hasNext()) {
                solution.run();
                solution.println();
                solution.println("----------------------------------");
            }
            solution.println("time: " + (System.currentTimeMillis() - timeout));
        }
        solution.close();
        reader.close();
    }
}