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.ArrayList;
import java.util.Arrays;
import java.util.List;

public class D {

	static int N, T;
	static int[] a;
	static int MAX = 300;
	static int[] longestStart, longestEnd, combined;

	public static void main(String[] args) throws IOException {
		int[] nt = readIntArray();
		N = nt[0];
		T = nt[1];
		a = readIntArray();

		combined = new int[N * MAX];
		for (int i = 0; i < combined.length; i++) {
			combined[i] = a[i % N];
		}

		longestStart = new int[combined.length];
		Arrays.fill(longestStart, -1);
		for (int i = 0; i < longestStart.length; i++) {
			longestStart[i] = longestNondecSubSeqStart(i);
		}

		longestEnd = new int[combined.length];
		Arrays.fill(longestEnd, -1);
		for (int i = longestEnd.length - 1; i >= 0; i--) {
			longestEnd[i] = longestNondecSubSeqEnd(i);
		}

		long max = 0;
		for (int i = 0; i < a.length; i++) {
			int cnt = 0;
			for (int j = 0; j < a.length; j++) {
				if (a[j] == a[i])
					cnt++;
			}

			int[] bestStart = new int[MAX + 1];
			for (int j = 0; j < combined.length; j++) {
				if (combined[j] <= a[i]) {
					int ind = (j + 1) / N + ((j + 1) % N == 0 ? 0 : 1);
					bestStart[ind] = Math.max(bestStart[ind], longestStart[j]);
				}
			}

			int[] bestEnd = new int[MAX + 1];
			for (int j = 0; j < combined.length; j++) {
				if (combined[j] >= a[i]) {
					int ind = ((combined.length - j) / N) + ((combined.length - j) % N == 0 ? 0 : 1);
					bestEnd[ind] = Math.max(bestEnd[ind], longestEnd[j]);
				}
			}
			
			for (int start = 0; start <= MAX; start++) {
				for (int end = 0; end <= MAX; end++) {
					if (start + end > T) {
						continue;
					}
					
					long cur = bestStart[start];
					cur += bestEnd[end];
					cur += cnt * (T - start - end);
					max = Math.max(cur, max);
				}
			}
		}

		System.out.println(max);
	}

	static int longestNondecSubSeqEnd(int i) {
		if (longestEnd[i] != -1)
			return longestEnd[i];

		int ans = 1;
		for (int j = i + 1; j <= Math.min(i + N, longestEnd.length - 1); j++) {
			if (combined[j] >= combined[i]) {
				int cur = longestNondecSubSeqEnd(j) + 1;
				ans = Math.max(cur, ans);
			}
		}

		return ans;
	}

	static int longestNondecSubSeqStart(int i) {
		if (longestStart[i] != -1)
			return longestStart[i];

		int ans = 1;
		for (int j = i - 1; j >= Math.max(i - N, 0); j--) {
			if (combined[i] >= combined[j]) {
				int cur = longestNondecSubSeqStart(j) + 1;
				ans = Math.max(cur, ans);
			}
		}

		return ans;
	}

	private static void append(StringBuilder sb, int i) {
		if (sb.length() > 0)
			sb.append('\n');
		sb.append(i);
	}

	static InputStreamReader isr = new InputStreamReader(System.in);
	static BufferedReader br = new BufferedReader(isr);
	static StringBuilder sb = new StringBuilder();

	static String readNextToken() throws IOException {
		sb.setLength(0);
		char c = ' ';
		do {
			c = ((char) br.read());
			if (Character.isWhitespace(c)) {
				if (sb.length() > 0) {
					break;
				}
			} else {
				sb.append(c);
			}
		} while (true);

		return sb.toString();
	}

	static int ni() throws Exception {
		return Integer.parseInt(readNextToken());
	}

	static long nl() throws Exception {
		return Long.parseLong(readNextToken());
	}

	static int[] readIntArray() throws IOException {
		String[] v = br.readLine().split(" ");
		int[] ans = new int[v.length];

		for (int i = 0; i < ans.length; i++) {
			ans[i] = Integer.valueOf(v[i]);
		}

		return ans;
	}

	static long[] readLongArray() throws IOException {
		String[] v = br.readLine().split(" ");
		long[] ans = new long[v.length];

		for (int i = 0; i < ans.length; i++) {
			ans[i] = Long.valueOf(v[i]);
		}

		return ans;
	}

}
