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 {
	public static void main(String args[]) {new Main().run();}

	FastReader in = new FastReader();
	PrintWriter out = new PrintWriter(System.out);
	void run(){
		work();
		out.flush();
	}
	long mod=998244353;
	long gcd(long a,long b) {
		return b==0?a:gcd(b,a%b);
	}
	void work() {
		int n=in.nextInt();
		int T=in.nextInt();
		int[] A=new int[n];
		for(int i=0;i<n;i++)A[i]=in.nextInt();
		if(T<=200) {
			int[] B=new int[n*T];
			for(int i=0;i<n*T;i++) {
				B[i]=A[i%n];
			}
			out.println(find(B));
		}else {
			long ret=0;
			for(int i=0;i<n;i++) {
				ArrayList<Integer> list1=new ArrayList<>();
				ArrayList<Integer> list2=new ArrayList<>();
				int cnt=0;
				for(int j=0;j<n;j++) {
					if(A[i]<=A[j]) {
						list1.add(A[j]);
					}
					if(A[i]>=A[j]) {
						list2.add(A[j]);
					}
					if(A[i]==A[j])cnt++;
				}
				int[] B1=new int[list1.size()*100];
				int[] B2=new int[list2.size()*100];
				for(int j=0;j<B1.length;j++) {
					B1[j]=list1.get(j%list1.size());
				}
				for(int j=0;j<B2.length;j++) {
					B2[j]=list2.get(j%list2.size());
				}
				ret=Math.max((long)cnt*(T-200)+find(B1)+find(B2), ret);
//				out.println(cnt);
			}
			out.println(ret);
		}
	}
	private int find(int[] A) {
		int n=A.length;
		int[] rec=new int[n];
		int p=0;
		for(int i=0;i<n;i++) {
			if(p==0||A[i]>=rec[p-1]) {
				rec[p++]=A[i];
			}else {
				int l=0,r=p;
				while(l<r) {
					int m=(l+r)/2;
					if(rec[m]<=A[i]) {
						l=m+1;
					}else {
						r=m;
					}
				}
				rec[l]=A[i];
			}
		}
		return p;
	}
}	



class FastReader
{
	BufferedReader br;
	StringTokenizer st;

	public FastReader()
	{
		br=new BufferedReader(new InputStreamReader(System.in));
	}

	public String next() 
	{
		if(st==null || !st.hasMoreElements())
		{
			try {
				st = new StringTokenizer(br.readLine());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return st.nextToken();
	}

	public int nextInt() 
	{
		return Integer.parseInt(next());
	}

	public long nextLong()
	{
		return Long.parseLong(next());
	}
}