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.*;

public class C323D
{

private static StringTokenizer st;
    
    public static void nextLine(BufferedReader br) throws IOException
    {
        st = new StringTokenizer(br.readLine());
    }
    
    public static int nextInt()
    {
        return Integer.parseInt(st.nextToken());
    }
    
    public static String next()
    {
        return st.nextToken();
    }
    
    public static long nextLong()
    {
        return Long.parseLong(st.nextToken());
    }

    public static double nextDouble()
    {
        return Double.parseDouble(st.nextToken());
    }
    
    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        nextLine(br);
        int n = nextInt();
        int T = nextInt();
        int[] a = new int[n];
        int[] freqs = new int[301];
        nextLine(br);
        for (int i = 0; i < n; i++)
        {
            a[i] = nextInt();
            freqs[a[i]]++;
        }
        
        ArrayList<Integer> numlist = new ArrayList<Integer>();
        int maxfreq = 0;
        for (int i = 0; i < freqs.length; i++)
        {
            maxfreq = Math.max(maxfreq, freqs[i]);
            if (freqs[i] > 0) numlist.add(i);
        }
        int[] revindex = new int[numlist.size()];
        int[] index = new int[301];
        Arrays.fill(index, -1);
        for (int i = 0; i < numlist.size(); i++)
        {
            revindex[i] = numlist.get(i);
            index[numlist.get(i)] = i;
        }
        
        int M = numlist.size();
        int[][][] fdp = new int[M][M][n];
        for (int i = 0; i <= index[a[0]]; i++)
        {
            for (int j = index[a[0]]; j < M; j++)
            {
                fdp[i] [j] [0] = 1;
            }
        }
        /*
        System.out.println("Round 0");
        for (int i = 0; i < M; i++)
        {
            for (int j = 0; j < M; j++)
            {
                System.out.print(fdp[i][j][0] + " ");
            }
            System.out.println();
        }*/
        for (int i = 1; i < n; i++)
        {
            int pos = index[a[i]];
            for (int j = 0; j < M; j++)
            {
                for (int k = 0; k < M; k++)
                {
                    if (j <= pos && k >= pos)
                    {
                        fdp[j][k][i] = Math.max(fdp[j][k][i-1], fdp[j][pos][i-1] + 1);
                    }
                    else
                    {
                        fdp[j][k][i] = fdp[j][k][i-1];
                    }
                }
            }
            /*
            System.out.println("For round " + i);
            for (int kk = 0; kk< M; kk++)
            {
                for (int ll = 0; ll < M; ll++)
                {
                    System.out.print(fdp[kk][ll][i] + " ");
                }
                System.out.println();
            }
            */
        }
        /*
        for (int i = 0; i < M; i++)
        {
            for (int j = 0; j < M; j++)
            {
                System.out.print(fdp[i][j][n-1] + " ");
            }
            System.out.println();
        }*/
          
        
        int[][] dp = new int[n][M];
        for (int i = 0; i < M; i++)
        {
            dp[n-1][i] = fdp[i][M - 1][n-1];
        }
        
        for (int i = n-2; i >= 0; i--)
        {
            for (int j = 0; j < M; j++)
            {
                int best = 0;
                for (int k = j; k < M; k++)
                {
                    best = Math.max(best, fdp[j][k][n-1] + dp[i+1][k]);
                }
                dp[i][j] = best;
            }
        }
        /*
        for (int i = 0; i < n; i++)
        {
            System.out.println(Arrays.toString(dp[i]));
        }*/
        
        if (n > T)
        {
            System.out.println(dp[n-T][0]);
        }
        else
        {
            System.out.println(dp[0][0] + maxfreq * (T - n));
        }
    }

}