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. 
/**
 * @author Aydar Gizatullin a.k.a. lightning95, aydar.gizatullin@gmail.com
 *         Created on 8/29/15.
 */


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D {
    FastScanner in;
    PrintWriter out;
    boolean systemIO = true;

    int gcd(int a, int b) {
        while (a > 0 && b > 0) {
            if (a > b) {
                a %= b;
            } else {
                b %= a;
            }
        }
        return a + b;
    }

    class Tri {
        int x, y, d;

        Tri(int x, int y, int d) {
            this.x = x;
            this.y = y;
            this.d = d;
        }
    }

    public void solve() {
        int n = in.nextInt();
        int t = in.nextInt();

        int[] a = new int[n * (Math.min(n, t) + 1)];
        for (int i = 0; i < n; ++i) {
            a[i] = in.nextInt();
        }
        for (int i = n; i < a.length; ++i) {
            a[i] = a[i - n];
        }

        int[] d = new int[a.length + 1];
        Arrays.fill(d, Integer.MAX_VALUE);
        d[1] = a[0];
        d[0] = -1;

        for (int i = 0; i < n * Math.min(n, t) ; i++) {
            int l = 0;
            int r = i + 1;
            while (l + 1 < r){
                int m = (l + r) / 2;
                if (d[m] <= a[i]){
                    l = m;
                } else {
                    r = m;
                }
            }
            if (d[l] <= a[i] && a[i] < d[l + 1]){
                d[l + 1] = a[i];
            }
        }

        int max = 0;
        for (int i = 0; i < d.length; ++i){
            if (d[i] < Integer.MAX_VALUE) {
                max = Math.max(max, i);
            }
        }
        for (int i = a.length - n; i < a.length; i++) {
            int l = 0;
            int r = i + 1;
            while (l + 1 < r){
                int m = (l + r) / 2;
                if (d[m] <= a[i]){
                    l = m;
                } else {
                    r = m;
                }
            }
            if (d[l] <= a[i] && a[i] < d[l + 1]){
                d[l + 1] = a[i];
            }
        }
        int max2 = 0;
        for (int i = 0; i < d.length; ++i){
            if (d[i] < Integer.MAX_VALUE) {
                max2 = Math.max(max2, i);
            }
        }
        if (n <= t){
            out.println(1L * max + (max2 - max) * (t - n));
        } else {
            out.println(max);
        }
        /*for (int i = 0; i < d.length; ++i){
            System.err.print(d[i] + " ");
        }
        System.err.println();*/
    }

    public void run() {
        try {
            if (systemIO) {
                in = new FastScanner(System.in);
                out = new PrintWriter(System.out);
            } else {
                in = new FastScanner(new File("a.in"));
                out = new PrintWriter(new File("a.out"));
            }
            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;


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

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

        String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                return null;
            }
        }

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

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

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

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

    }

    public static void main(String[] arg) {
        new D().run();
    }
}

