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.*;
import java.math.*;
public class Main
{
    static class Reader
    {
        private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;}
        public int read() {if (numChars == -1) throw new InputMismatchException();if (curChar >= numChars) {curChar = 0;try { numChars = mIs.read(buf);} catch (IOException e) { throw new InputMismatchException();}if (numChars <= 0) return -1; }return buf[curChar++];}
        public String nextLine(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isEndOfLine(c));return res.toString() ;}
        public String s(){int c = read();while (isSpaceChar(c)) c = read();StringBuilder res = new StringBuilder();do {res.appendCodePoint(c);c = read();}while (!isSpaceChar(c));return res.toString();}
        public long l(){int c = read();while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }long res = 0; do{ if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read();}while(!isSpaceChar(c));return res * sgn;}
        public int i(){int c = read() ;while (isSpaceChar(c)) c = read();int sgn = 1;if (c == '-') { sgn = -1 ; c = read() ; }int res = 0;do{if (c < '0' || c > '9') throw new InputMismatchException();res *= 10 ; res += c - '0' ; c = read() ;}while(!isSpaceChar(c));return res * sgn;}
        public double d() throws IOException {return Double.parseDouble(s()) ;}
        public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; }
        public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; }
        public int[] arr(int n){int[] ret = new int[n];for (int i = 0; i < n; i++) {ret[i] = i();}return ret;}
    }
   
   
 
           //       |----|       /\      |    |   -----   |
           //       |   /       /  \     |    |     |     |
           //       |--/       /----\    |----|     |     |
           //       |   \     /      \   |    |     |     |
           //       |    \   /        \  |    |   -----   -------
 
    static long map[][];
    static int size;
    public static long[][] expo(long pow)	
    {
		long ans[][]=new long[size][size];
		for(int i=0;i<size;i++)	
		ans[i][i]=1;
		while(pow!=0)
		{
			if((pow&1)!=0)	
			    ans=multiplyMatrix(ans, map);
			map=multiplyMatrix(map, map);
			pow/=2;
		}
		return ans;
	}
	public static long[][] multiplyMatrix(long m[][], long m2[][])	
	{
		long ans[][]=new long[size][size];
		for(int i=0;i<size;i++)
		for(int j=0;j<size;j++)
		{
			ans[i][j] =-(long)Math.pow(10,18);
			for(int k=0;k<size;k++)
			{
			    ans[i][j]=Math.max(ans[i][j],m[i][k]+m2[k][j]);
			}
		}
		return	ans;
	}
    public static void main(String[] args)throws IOException
    {
        PrintWriter out= new PrintWriter(System.out);
        Reader sc=new Reader();
        int t=sc.i();
        int n=sc.i();
        size=t;
        map=new long[size][size];
        int arr[]=new int[size];
        for(int i=0;i<t;i++)
        arr[i]=sc.i();
        for(int i=0;i<size;i++)
        {
            for(int j=0;j<size;j++)
            {
                if(arr[i]>arr[j])
                map[i][j]=-(long)Math.pow(10,18);
                else
                {
                    map[i][j]=1;
                    for(int k=0;k<j;k++)
                    {
                        if(arr[k]<=arr[j])
                        map[i][j]=Math.max(map[i][j],map[i][k]+1);
                    }
                }
            }
        }
        long ans[][]=expo(n);
        long val=0;
        for(int i=0;i<size;i++)
        for(int j=0;j<size;j++)
        val=Math.max(val,ans[i][j]);
        out.println(val-1);
        out.flush();
    }
}