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.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        new Main().run(in, out);
        out.close();
    }

    public static long mod = 17352642619633L;

    void run(FastScanner in, PrintWriter out) {

        // since 1<=n<=100
        // after 100, youd pick all the elements already

        int N = in.nextInt();
        int T = in.nextInt();
        int[] a = new int[N];
        int[] cnt = new int[302];
        for (int i = 0; i < N; i++) {
            a[i] = in.nextInt();
            cnt[a[i]]++;
        }

        for (int i = 300; i >= 0; i--) cnt[i] = Math.max(cnt[i], cnt[i+1]);

        ST st = new ST();

        int longest = 0;

        for (int j = 0; j < Math.min(100, T); j++) {
            for (int i = N-1; i >= 0; i--) {
                int curr = st.get(1, a[i], 300) + 1;
                st.set(1, a[i], curr);
                longest = Math.max(longest, curr);
            }
        }

        if (T <= 100) {
            out.println(longest);
        } else {
            longest += (T-100) * cnt[0];
            out.println(longest);
        }

    }


    class ST {
        int[] lo;
        int[] hi;
        int[] st;

        ST() {
            int N = 300;
            lo = new int[N<<2];
            hi = new int[N<<2];
            st = new int[N<<2];
            getBounds(1, 1, N);
        }

        void getBounds(int i, int a, int b) {
            lo[i] = a;
            hi[i] = b;
            if (a == b) return;
            int m = (a+b)>>1;
            getBounds(i<<1, a, m);
            getBounds(i<<1|1, m+1, b);
        }

        void set(int i, int a, int v) {
            if (a < lo[i] || a > hi[i]) return;
            if (a == lo[i] && a == hi[i]) {
                st[i] = Math.max(st[i], v);
                return;
            }

            set(i<<1, a, v);
            set(i<<1|1, a, v);
            st[i] = Math.max(st[i<<1], st[i<<1|1]);
        }

        int get(int i, int a, int b) {
            if (b < lo[i] || a > hi[i]) return 0;
            if (a <= lo[i] && hi[i] <= b) {
                return st[i];
            }
            return Math.max(get(i<<1, a, b), get(i<<1|1, a, b));
        }

    }




    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in));
            st = null;
        }

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

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

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