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. 
/*
    Editorial + https://codeforces.com/blog/entry/20692?#comment-477985
    Used BIT for LIS. Inspired from Rajat De's and AnimeshF's solution.
 */

//created by Whiplash99
import java.io.*;
import java.util.*;
public class A
{
    static class BIT
    {
        int size;
        int[] table;

        BIT(int size)
        {
            table=new int[size+1];
            this.size=size+1;
        }
        void update(int i, int val)
        {
            i++;
            while(i<size)
            {
                table[i]=Math.max(table[i],val);
                i+=Integer.lowestOneBit(i); //i+=i&-i
            }
        }
        int maxQuery(int i)
        {
            int max=0; i++;
            while (i>0)
            {
                max=Math.max(max,table[i]);
                i-=Integer.lowestOneBit(i);//i-=i&-i
            }
            return max;
        }
    }

    private static ArrayList<Integer> build(ArrayList<Integer> a, int N, int times)
    {
        ArrayList<Integer> b=new ArrayList<>();
        for(int i=0;i<N*times;i++) b.add((i<N)?a.get(i):b.get(i-N));

        return b;
    }
    private static ArrayList<Integer> LIS(ArrayList<Integer> a)
    {
        BIT FT=new BIT(305);
        ArrayList<Integer> res=new ArrayList<>();

        for(int i=0;i<a.size();i++)
        {
            int ans=FT.maxQuery(a.get(i))+1;
            FT.update(a.get(i),ans);

            res.add(ans);
        }
        return res;
    }
    public static void main(String[] args) throws IOException
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

        int i,N;

        String[] s=br.readLine().trim().split(" ");
        N=Integer.parseInt(s[0]);
        int T=Integer.parseInt(s[1]);

        s=br.readLine().trim().split(" ");
        ArrayList<Integer> a=new ArrayList<>();
        for(i=0;i<N;i++) a.add(Integer.parseInt(s[i]));

        int max=0;

        if(T<=2*N)
        {
            ArrayList<Integer> b=build(a,N,T);
            ArrayList<Integer> res=LIS(b);

            for(i=0;i<res.size();i++) max=Math.max(max,res.get(i));
        }
        else
        {
            ArrayList<Integer> b=build(a,N,N);
            ArrayList<Integer> res1=LIS(b);

            int[] count=new int[305];
            for(i=0;i<N;i++) count[a.get(i)]++;

            for(i=0;i<b.size();i++) b.set(i,301-b.get(i));
            Collections.reverse(b);
            ArrayList<Integer> res2=LIS(b);
            Collections.reverse(res2);

            for(i=0;i<N;i++)
            {
                int tmp= res1.get(res1.size()-N+i);
                tmp+=count[a.get(i)]*(T-2*N);

                int max2=0;
                for(int j=0;j<N;j++)
                {
                    if(a.get(j)>=a.get(i))
                        max2=Math.max(max2,res2.get(j));
                }

                tmp+=max2;
                max=Math.max(max,tmp);
            }
        }

        System.out.println(max);
    }
}