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.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;


public class B {

	static ArrayList<Edge>[] adjList;
	static int extra, f[], memo[][][];

	static int dp(int t, int u, int k)
	{
		if(k == 0)
			return 0;
		if(memo[t][u][k] != -1)
			return memo[t][u][k];
		int ret = 0;
		for(Edge e: adjList[u])
			ret = Math.max(ret, e.w + dp(t, e.v, k - 1));
		if(t == 0)
			ret = Math.max(ret, f[u] * extra + dp(1, u, k));
		return memo[t][u][k] = ret;
	}

	public static void main(String[] args) throws IOException 
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int n = sc.nextInt(), t = sc.nextInt(), A[] = new int[n];
		for(int i = 0; i < n; ++i)
			A[i] = sc.nextInt();
		adjList = new ArrayList[301];
		for(int i = 0; i <= 300; ++i)
			adjList[i] = new ArrayList<Edge>();

		f = new int[301];
		for(int i = 0; i < n; ++i)
			if(f[A[i]]++ == 0)
			{
				int[] L = lis(A, n, A[i]);
				for(int j = 0; j < n; ++j)
					if(L[j] != 0)
						adjList[A[i]].add(new Edge(A[j], L[j]));
			}
		
		memo = new int[2][301][301];
		for(int[][] x1: memo)
			for(int[] x2: x1)
				Arrays.fill(x2, -1);
		int ans = 0, p = Math.min(t, 300);
		extra = t - p;
		for(int x: A)
			ans = Math.max(ans, dp(0, x, p));
		out.println(ans);
		out.flush();
		out.close();
	}

	static int[] lis(int[] A, int len, int lim)
	{
		int[] L = new int[len];
		for(int i = 0; i < len; ++i)
			if(A[i] >= lim)
			{
				int curL = 1;
				for(int j = 0; j < i; ++j)
					if(A[j] <= A[i] && L[j] + 1 > curL)
						curL = L[j] + 1;
				L[i] = curL;
			}
		return L;
	}

	static class Edge { int v, w; Edge(int a, int b) { v = a; w = b; } public String toString() { return v + " " + w; }}

	static class Scanner 
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		public String next() throws IOException 
		{
			while (st == null || !st.hasMoreTokens()) 
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}


	}
}