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


public class D {

	public static void main(String[] args) {
		
		Scanner in = new Scanner(System.in);
		
		int n = in.nextInt();
		int t = in.nextInt();
		
		int[] a = new int[n];
		for(int i=0;i<n;++i){
			a[i] = in.nextInt();
		}
		
		int[] counts = new int[301];
		int max = 0;
		for(int i=0;i<n;++i){
			counts[a[i]]++;
			max = Math.max(max,counts[a[i]]);
		}
		
		if(t<400){
			int result = solve(a,t);
			System.out.println(result);
		}else{
			int result = solve(a,400);
			System.out.println(result+max*(t-400));
		}

	}

	private static int solve(int[] a, int t) {
		int n = a.length*t;		
		int[] na = new int[n];
		int count = 0;
		for(int i=0;i<t;++i){
			for(int j=0;j<a.length;++j){
				na[count] = a[j];
				count++;
			}
		}
		
		int[] dp = new int[n];
		dp[0] = 1;
		int max = 1;
		for(int i=1;i<n;++i){
			dp[i] = 1;
			for(int j=i-1;j>=0&&j>=i-a.length;--j){
				if(na[j]<=na[i]){
					dp[i] = Math.max(dp[i],dp[j]+1);
					max = Math.max(max, dp[i]);
				}
			}
		}		
		
		return max;
	}

}
