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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Map;
import java.util.StringTokenizer;

public class OnceAgain {
    public static void main(String[] args) {
        FastReader sc = new FastReader();
        final int maxAi = 3000;
        int n = sc.nextInt();
        int t = sc.nextInt();
        int[]ar = sc.readArray(n);

        int m = n * Math.min(n, t);
        int[] br = new int[m];
        for(int i = 0; i < m; ++i){
            br[i] = ar[i % n];
        }

        int lisLen = lenOfLis(br);

        int[] freq = new int[maxAi + 1];
        int maxFreq = 0;
        for(int a : ar){
            ++freq[a];
            maxFreq = Math.max(maxFreq, freq[a]);
        }
        //System.out.println(lisLen +", " + maxFreq);
        int ans = lisLen + (Math.max(0, t - m / n)) * maxFreq;
        System.out.println(ans);

    }

    private static int lenOfLis(int[] arr){
        int n = arr.length;
        int[] lis = new int[n];
        Arrays.fill(lis, 1);
        for(int i = 1; i < n; ++i){
            for(int j = 0; j < i; ++j){
                if(arr[j] <= arr[i])
                    lis[i] = Math.max(lis[i], 1 + lis[j]);
            }
        }
        int maxLen = 1;
        for(int len : lis)
            maxLen = Math.max(maxLen, len);

        return maxLen;
    }
    private static class FastReader {
        private BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        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());
        }

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] readArray(int n){
            int[] arr = new int[n];
            for(int i = 0; i < n; ++i)
                arr[i] = nextInt();

            return arr;
        }
        long[] readLongArray(int n){
            long[] arr = new long[n];
            for(int i = 0; i < n; ++i)
                arr[i] = nextLong();

            return arr;
        }

        double[] readDoubleArray(int n){
            double[] arr = new double[n];
            for(int i = 0; i < n; ++i)
                arr[i] = nextDouble();
            return arr;
        }
    }
}
