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.*;

public class D{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long T = sc.nextInt();
		
		int count[] = new int[301];
		int arr[] = new int[N];
		for(int i = 0; i < N; i++){
			arr[i] = sc.nextInt();
			count[arr[i]]++;
		}

		int max = 0;
		for(int i = 0; i < 301; i++)
			max =  Math.max(count[i], max);

		int dp[][];
		if(T < N)
			dp = new int[(int)T+1][N];
		else dp = new int[N+1][N];

		int max_dp = 0;
		for(int i = 1; i < dp.length; i++){
			for(int j = 0; j < N ;j++){
				dp[i][j] = 1;
				for(int k = 0; k < N; k++)
					if(arr[k] <= arr[j])
						dp[i][j] = Math.max(dp[i][j],dp[i-1][k] + 1);
				for(int k = 0; k < j; k++)
					if(arr[k] <= arr[j])
						dp[i][j] = Math.max(dp[i][j],dp[i][k] + 1);
				max_dp = Math.max(max_dp,dp[i][j]);
			}
		}

		max_dp += (T - Math.min(N,T))*max;

		System.out.println(max_dp);
	}
}