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.Stack;
import java.util.StringTokenizer;

import static java.lang.Math.abs;
import static java.lang.Math.max;
import static java.lang.Math.min;

public class Main {
	
	static final int MOD = (int) 1e9 + 7;
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		
		int n, t;
		
		n = sc.nextInt();
		t = sc.nextInt();
		
		if(t > 1)
		{
			int to = Math.min(100, t);
			int m = (n * to);
			
			int arr[] = new int[m];
			
			for(int i = 0; i < n; ++i) arr[i] = sc.nextInt();
			for(int i = n; i < m; ++i) arr[i] = arr[i - n];
			
			int dp[] = new int[m];
			
			int max = 1;
			int max2 = 1;
			
			Arrays.fill(dp, 1);
			
			for(int i = 1; i < m; ++i)
				for(int j = i - 1; j >= 0; --j)
					if(arr[j] <= arr[i] && dp[j] + 1 > dp[i])
					{
						max = Math.max(max, dp[i] = dp[j] + 1);
						if(i < n * (to - 1))
							max2 = max;
					}
			
			out.println(max + (t - to) * (max - max2));
		}
		else
		{
			int arr[] = new int[n];
			int max = 1;
			
			for(int i = 0; i < n; ++i) arr[i] = sc.nextInt();
			int dp[] = new int[n];
			Arrays.fill(dp, 1);
			
			for(int i = 1; i < n; ++i)
				for(int j = i - 1; j >= 0; --j)
					if(arr[j] <= arr[i] && dp[j] + 1 > dp[i])
						max = Math.max(max, dp[i] = dp[j] + 1);
			
			out.println(max);
		}
		
		
		
		out.flush();
		out.close();
	}
	
	static class Pair implements Comparable<Pair> {
		int a, b;
		
		public Pair(int x, int y) {
			a = x; b = y;
		}
		
		@Override
		public int compareTo(Pair p) {
			return (a == p.a)?b - p.b:a - p.a; 
		}
		
		@Override
		public String toString() {
			return a + " " + b;
		}
	}
	
	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();}
	}
}