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.*;
public class Main {
static int[][] MatrixMultiply(int a[][],int b[][]){
	int c[][] = new int[a.length][a.length];
	int max[] = new int[a.length];
	for(int i = 0;i < a.length;i++){
		for(int j = i;j < a.length;j++){
			int maxTemp = 0;
			for(int k = j;k >= i;k--){
				maxTemp = Math.max(maxTemp,b[k][j]);
				max[k] = maxTemp;
			}
			for(int k = i;k <= j;k++){
				c[i][j] = Math.max(c[i][j],a[i][k] + max[k]);
			}
		}
	}
	return c;
}	
static int [][] exponentiate(int ans[][],int t){
	if(t == 1)
		return ans;
	else if(t == 2){
		return MatrixMultiply(ans,ans);
	}
	else if((t & 1) == 0){
		int res[][] = exponentiate(ans,t/2);
		return MatrixMultiply(res,res);
	}
		int res[][] = exponentiate(ans,t - 1);
		return MatrixMultiply(res,ans);
}	
public static void main(String [] args)throws Exception{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = new StringTokenizer(br.readLine());
	int n = Integer.parseInt(st.nextToken());
	int t = Integer.parseInt(st.nextToken());
	
	int array[] = new int[n];
	st = new StringTokenizer(br.readLine());
	for(int i = 0;i < n;i++){
		array[i] = Integer.parseInt(st.nextToken());
	}
	int lis[][] = new int[n][n];
	lis = getLis(array);
	int ans[][] = new int[301][301];
	for(int i = 0;i < n;i++){
		for(int j = 0;j < n;j++){
			ans[array[i]][array[j]] = Math.max(ans[array[i]][array[j]],lis[i][j]);
		}
	}
	/*
	for(int i = 0;i < n;i++){
		for(int j = 0;j < n;j++){
			System.out.print(lis[i][j] + " ");
		}
		System.out.println();
	}
	*/
	ans = exponentiate(ans,t);
	int res = 0;
	for(int i = 0;i < ans.length;i++){
		for(int j = 0;j < ans.length;j++){
			res = Math.max(res,ans[i][j]);
		}
	}
	System.out.print(res);
}
static int [][] getLis(int array[]){
	int n = array.length;
	int res[][] = new int[n][n];
	for(int i = 0;i < n;i++){
		for(int j = i;j < n;j++){
			if(array[j] < array[i])continue;
			if(i == j)res[i][j] = 1;
			else{
				res[i][j] = 2;
				for(int k = i + 1;k < j;k++){
					if(array[k] <= array[j] && array[k] >= array[i])
					res[i][j] = Math.max(res[i][j],res[i][k] + 1);
				}
			}
		}
	}
	return res;
}
}