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.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class OnceAgain {

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = in.readLine();
		StringTokenizer st = new StringTokenizer(line);

		final int n = Integer.parseInt(st.nextToken());
		final int T = Integer.parseInt(st.nextToken());

		line = in.readLine();
		st = new StringTokenizer(line);
		

		int[] a = new int[n];
		int[] counts = new int[300 + 1];
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(st.nextToken());
			counts[a[i]]++;
		}
		in.close();

		// find the longest subsequence up to each i

		final int M = n * n, N =   2*M;
		int[] maxFromCounts = new int[M], maxToCounts = new int[N];
		for (int l = 0; l < N; l++) {
			maxToCounts[l] = 1;
			for (int i = l-1; i >= 0 && i >= l - n; i--) {
				if (a[i%n] > a[l%n]) {
					continue;
				}
				if (maxToCounts[l] <= maxToCounts[i]) {
					maxToCounts[l] = maxToCounts[i] + 1;
				}
			}
		}

		for (int l = M - 1; l >= 0; l--) {
			maxFromCounts[l] = 1;
			for (int i = M - 1; i > l; i--) {
				if (a[l%n] > a[i%n])
					continue;
				if ( maxFromCounts[l] <= maxFromCounts[i]) {
					maxFromCounts[l] = maxFromCounts[i] + 1;
				}
			}
		}

		int len = 0;
		if (T > 2*n) {
			// find the max number
			for (int i = M-n; i < M; i++) {

				int t1 = maxToCounts[i] + (T - n*2) * counts[a[i%n]];
				int max = 1;

				for (int j = 0; j < M; j++) {
					if (a[j%n] < a[i%n]) {
						continue;
					}

					if (max < maxFromCounts[j]) {
						max = maxFromCounts[j];
					}
				}
				t1 += max;
				if (len < t1) {
					len = t1;
				}
			}
		} else {
			for (int i = 0; i < n * T; i++) {
				if (len < maxToCounts[i]) {
					len = maxToCounts[i];
				}
			}
		}

		System.out.println(len);
	}

}