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.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;

public class D
{
	public static final Random RANDOM = new Random(System.currentTimeMillis());
	private BufferedReader bufferedReader;
	private StringTokenizer stringTokenizer;
	private PrintWriter printWriter;

	public D()
	{
		this(new BufferedReader(new InputStreamReader(System.in)));
	}

	public D(BufferedReader bufferedReader)
	{
		this.bufferedReader = bufferedReader;
		this.stringTokenizer = null;
		this.printWriter = new PrintWriter(new BufferedOutputStream(System.out));
	}

	public D(String file) throws FileNotFoundException
	{
		this(new BufferedReader(new InputStreamReader(new FileInputStream(file))));
	}

	private String next() throws IOException
	{
		while ((this.stringTokenizer == null) || (!this.stringTokenizer.hasMoreTokens()))
		{
			this.stringTokenizer = new StringTokenizer(this.bufferedReader.readLine());
		}
		return stringTokenizer.nextToken();
	}

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

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

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

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

	public void close()
	{
		printWriter.close();
	}

	public static void main(String[] args)
	{
		D template = new D();
		try
		{
			template.solve();
		}
		catch (IOException exception)
		{
			exception.printStackTrace();
		}
		template.close();
	}

	public static int[] concatenate(int n, int t, int[] a)
	{
		int[] result = new int[n * t];
		for (int indexN = 0; indexN < n; indexN++)
		{
			for (int indexT = 0; indexT < t; indexT++)
			{
				result[indexT * n + indexN] = a[indexN];
			}
		}
		return result;
	}

	public static int[] countStart(int n, int[] a)
	{
		int[] result = new int[300];
		for (int index = n - 1; index >= 0; index--)
		{
			int next = a[index] - 1;
			int maxCount = 0;
			for (int start = 300 - 1; start >= 0; start--)
			{
				maxCount = Math.max(maxCount, result[start]);
				if (start <= next)
				{
					if (start == next)
					{
						maxCount += 1;
					}
					result[start] = maxCount;
				}
			}
		}
		return result;
	}

	public static int[] countMid(int n, int[] a)
	{
		int[] result = new int[300];
		for (int index = 0; index < n; index++)
		{
			int next = a[index] - 1;
			for (int mid = 0; mid < 300; mid++)
			{
				if (mid == next)
				{
					result[mid] += 1;
				}
			}
		}
		return result;
	}

	public static int[] countEnd(int n, int[] a)
	{
		int[] result = new int[300];
		for (int index = 0; index < n; index++)
		{
			int next = a[index] - 1;
			int maxCount = 0;
			for (int end = 0; end < 300; end++)
			{
				maxCount = Math.max(maxCount, result[end]);
				if (end >= next)
				{
					if (end == next)
					{
						maxCount += 1;
					}
					result[end] = maxCount;
				}
			}
		}
		return result;
	}

	//	public static int[][] count(int n, int[] a)
	//	{
	//		int[][] result = new int[300][300];
	//		for (int index = 0; index < n; index++)
	//		{
	//			int next = a[index] - 1;
	//			for (int start = 0; start < 300; start++)
	//			{
	//				int maxCount = 0;
	//				for (int end = start; end < 300; end++)
	//				{
	//					maxCount = Math.max(maxCount, result[start][end]);
	//					if (end >= next)
	//					{
	//						if (end == next)
	//						{
	//							maxCount += 1;
	//						}
	//						result[start][end] = maxCount;
	//					}
	//				}
	//			}
	//		}
	//		return result;
	//	}
	public static int solve(int n, int t, int[] a)
	{
		int result = 0;
		if (t > 2 * n)
		{
			int[] a2 = concatenate(n, n, a);
			int[] countStart = countStart(n * n, a2);
			int[] countEnd = countEnd(n * n, a2);
			int[] countMid = countMid(n, a);
			for (int mid = 0; mid < 300; mid++)
			{
				int count = countEnd[mid] + (t - 2 * n) * countMid[mid] + countStart[mid];
				if (count > result)
				{
					result = count;
				}
			}
		}
		else
		{
			result = countStart(n * t, concatenate(n, t, a))[0];
			
		}
		return result;
	}

	public void solve() throws IOException
	{
		int n = nextInt();
		int t = nextInt();
		int[] a = new int[n];
		for (int index = 0; index < n; index++)
		{
			a[index] = nextInt();
		}
		//		System.out.println(DTest.maxCount(n, a));
		this.printWriter.println(solve(n, t, a));
	}
}