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 D {
    FastScanner in;
    PrintWriter out;

    public void solve() throws IOException {
        int n = in.nextInt();
        int n2 = n * n;
        int t = in.nextInt();
        int[] a = new int[n * n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        for (int i = n; i < n2; i++) {
            a[i] = a[i - n];
        }
        int maxA = Arrays.stream(a).max().getAsInt();
        int[][] d = new int[n2][maxA + 1];
        for (int i = 0; i < n2; i++) {
            for (int j = 1; j <= maxA; j++) {
                if (i > 0) {
                    d[i][j] = d[i - 1][j];
                }
                if (a[i] <= j) {
                    if (i > 0) {
                        d[i][j] = Math.max(d[i][j], d[i - 1][a[i]] + 1);
                    } else {
                        d[i][j] = Math.max(d[i][j], 1);
                    }
                }
            }
        }
        if (t <= n) {
            out.println(d[n * t - 1][maxA]);
        } else {
            int[] count = new int[maxA + 1];
            for (int i = 0; i < n; i++) {
                count[a[i]]++;
            }
            out.println((t - n) * Arrays.stream(count).max().getAsInt() + d[n2 - 1][maxA]);
        }
    }

    public void run() {
        try {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);
            Locale.setDefault(Locale.US);

            solve();

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

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

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

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

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

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