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

public class D {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int t = s.nextInt();
		int[] nos = new int[n];
		for (int i=0; i<n; i++) {
			nos[i] = s.nextInt();
		}
		int[] dp = new int[n];
		Arrays.fill(dp, 0);
		dp[0] = 1;
		for (int j=0; j<Math.min(t,n); j++) {
			if (j==0) {
				for (int i=0; i<n; i++) {
					int best = 1;
					for (int k=0; k<i; k++) {
						if (nos[i]>=nos[k]) {
							best = Math.max(best, dp[k]+1);
						}
					}
					dp[i] = best;
				}
			} else {
				for (int i=0; i<n; i++) {
					int best = 1;
					for (int k=0; k<n; k++) {
						if (nos[i]>=nos[k]) {
							best = Math.max(best, dp[k]+1);
						}
					}
					dp[i] = best;
				}
			}
		}
		int ans = dp[0];
		for (int i=1; i<n; i++) ans = Math.max(ans, dp[i]);
		if (t>n){
			int[] freq = new int[300];
			for (int i=0; i<n; i++) {
				freq[nos[i]-1]++;
			}
			int mode = freq[0];
			for (int i=1; i<300; i++) {
				mode = Math.max(mode,freq[i]);
			}
			ans+=(t-n)*mode;
		}
		System.out.println(ans);
	}
}