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 CF582_D1_B {
	public static void main(String[] args)throws Throwable {
		MyScanner sc=new MyScanner();
		PrintWriter pw=new PrintWriter(System.out);
		
		int n=sc.nextInt();
		int t=sc.nextInt();
		int [] a=new int [n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextInt();
		int [] lis=new int [n];
		int max=0;
		for(int i=n-1;i>=0;i--){
			lis[i]=1;
			for(int j=n-1;j>i;j--)
				if(a[j]>=a[i] && lis[j]+1>lis[i])
					lis[i]=lis[j]+1;
			max=Math.max(max, lis[i]);
		}
		int [] dif=new int [n];
		int [] old=Arrays.copyOf(lis, lis.length);
		int lst=Math.min(305, t-1);
		for(int i=0;i<lst;i++){
			for(int j=n-1;j>=0;j--){
				int mx=0;
				for(int k=0;k<n;k++)
					if(a[j]<=a[k])
						mx=Math.max(mx, lis[k]+1);
				lis[j]=mx;
				max=Math.max(max, lis[j]);
			}
			for(int j=0;j<n;j++)
				dif[j]=lis[j]-old[j];
			old=Arrays.copyOf(lis, lis.length);
		}
		t=t-lst-1;
		for(int i=0;i<n;i++)
			max=Math.max(max, lis[i]+t*dif[i]);
		pw.println(max);
		pw.flush();
		pw.close();
	}
	
	static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner() {
			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;}
	}
}