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 Matrix {
    public static final int MAX_DIMENSION = 500;
	static int[] a=new int[MAX_DIMENSION];
	static int[] a_temp=new int[MAX_DIMENSION];
	static int[] amax=new int[MAX_DIMENSION];

	public static void main(String[] args) {
	    int n,M,max,result,m_temp;
		Scanner in=new Scanner(System.in);
		n=in.nextInt();M=in.nextInt();
		m_temp=0;result=0;
		for(int i=0;i<n;i++)
		{
			a[i]=in.nextInt();
			a_temp[a[i]]++;
			m_temp=Math.max(m_temp,a_temp[a[i]]);
		}
		for(int i=0;i<n*Math.min(n,M);i++)
		{
			max=0;
			for(int j=1;j<=a[i%n];j++)
				max=Math.max(max,amax[j]);
			amax[a[i%n]]=max+1;
			result=Math.max(result,amax[a[i%n]]);
		}
		if(M>n) result+=m_temp*(M-n);
		System.out.println(result);
	}
}