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. 
/*
    Source: https://codeforces.com/contest/582/submission/13390660
 */

//created by Whiplash99
import java.io.*;
import java.util.*;
public class A
{
    private static final long INF=(long)(1e15);
    static class Matrix
    {
        long[][] M; int N;
        Matrix(int N){this.N=N; M=new long[N][N];}
        void makeIdentity(){for(int i=0;i<N;i++) Arrays.fill(M[i],0);}
        void copy(Matrix source)
        {
            for(int i=0;i<N;i++)
                for(int j=0;j<N;j++)
                    M[i][j]=source.M[i][j];
        }
        void multiply(Matrix B, Matrix C)
        {
            for(int i=0;i<N;i++) Arrays.fill(C.M[i],0);
            for(int i=0;i<N;i++)
            {
                for (int j = 0; j < N; j++)
                {
                    C.M[i][j]=-INF;
                    for (int k = 0; k < N; k++)
                    {
                        if(M[i][k]>-INF&&B.M[k][j]>-INF)
                            C.M[i][j]=Math.max(C.M[i][j],add(M[i][k],B.M[k][j]));
                    }
                }
            }
            copy(C);
        }
        void pow(long b)
        {
            Matrix res=new Matrix(N), store=new Matrix(N);
            res.makeIdentity();
            while (b>0)
            {
                if((b&1)==1) res.multiply(this,store);
                this.multiply(this,store);
                b>>=1;
            }
            copy(res);
        }
    }
    private static long add(long a, long b){a+=b; return a;}
    public static void main(String[] args) throws IOException
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

        int i,j,k,N;

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

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

        Matrix A=new Matrix(N);
        for(i=0;i<N;i++)
        {
            for(j=0;j<N;j++)
            {
                if(a[j]<a[i]) A.M[i][j]=-INF;
                else
                {
                    A.M[i][j]=1;
                    for(k=0;k<j;k++)
                        if(a[k]<=a[j])
                            A.M[i][j]=Math.max(A.M[i][j],A.M[i][k]+1);
                }
            }
        }

        A.pow(T);
        long ans=0;
        for(i=0;i<N;i++)
        {
            for(j=0;j<N;j++)
                ans=Math.max(ans,A.M[i][j]);
        }

        System.out.println(ans);
    }
}