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.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.Vector;

public class OnceAgain {

	public static void main(String[] args) {
		InputReader ir = new InputReader(System.in);
		int n = ir.nextInt();
		int t = ir.nextInt();
		Integer[] a = new Integer[n];
		for (int i = 0; i < n; ++i) {
			a[i] = ir.nextInt();
		}
		
		int answer = (new OnceAgain(t, a)).solve1();
		
		OutputWriter ow = new OutputWriter(System.out);
		ow.print(answer);
		ow.close();
	}
	
	private int t;
	private Integer[] a;
	private OnceAgain(int t, Integer[] a) {
		this.t = t;
		this.a = a;
	}

	private Integer[] counting(Integer[] array) {
		Integer[] result = new Integer[(int)Algorithm.maxElement(array)+1];
		Arrays.fill(result, 0);
		
		for (int element : array) {
			++result[element];
		}
		
		return result;
	}
	
	private int getLongestNondescendingSubsequenceLength(Integer[] array) {
		int answer = 0;
		Integer[] dp = new Integer [array.length];
		for (int i = 0; i < array.length; ++i) {
			dp[i] = 1;
			for (int j = 0; j < i; ++j) {
				if (array[j] <= array[i]) {
					dp[i] = Math.max(dp[i], dp[j]+1);
				}
			}
			answer = Math.max(answer, dp[i]);
		}
		
		return answer;
	}
	
	private int solve1() {
		Integer[] array = new Integer[a.length * Math.min(a.length, t)];
		for (int i = 0; i < array.length; ++i) {
			array[i] = a[i % a.length];
		}
		Integer[] cnt = counting(a);
		
	
		int longestUndescendingSubsequenceLessLength = getLongestNondescendingSubsequenceLength(array);
		return longestUndescendingSubsequenceLessLength + Algorithm.maxElement(cnt) * (t - array.length / a.length);
	}
	
}


class InputReader {
    private InputStream stream;
    private byte[] buffer = new byte[10000];
    private int cur;
    private int count;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public static boolean isSpace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public int read() {
        if (count == -1) {
            throw new InputMismatchException();
        }
        try {
            if (cur >= count) {
                cur = 0;
                count = stream.read(buffer);
                if (count <= 0)
                    return -1;
            }
        } catch (IOException e) {
            throw new InputMismatchException();
        }
        return buffer[cur++];
    }

    public int readSkipSpace() {
        int c;
        do {
            c = read();
        } while (isSpace(c));
        return c;
    }

    public long nextLong() {
        int sgn = 1;
        int c = readSkipSpace();
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res = res * 10 + c - '0';
            c = read();
        } while (!isSpace(c));
        res *= sgn;
        return res;
    }
    
    public int nextInt(){return (int)nextLong();}
    
    public String nextString() {
    	String result = "";
    	int c = readSkipSpace();
    	do {
    		result += (char) c;
    		c = read();
    	} while(!isSpace(c));
    	return result;
    }

}


class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

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

}

class Pair <T1, T2> implements Comparable<Pair < T1, T2>> {
	public T1 first;
	public T2 second;
	public Pair(T1 first, T2 second) {
		this.first = first;
		this.second = second;
	}
	@SuppressWarnings("unchecked")
	@Override
	public int compareTo(Pair<T1, T2> arg0) {
		int firstCompare = ((Comparable<T1>)first).compareTo(arg0.first);
		return firstCompare == 0 ? ((Comparable<T2>)second).compareTo(arg0.second) : firstCompare;
	}
	
}

class Algorithm {
	public static <T extends Comparable<T>> T maxElement(T[] array) {
		return maxElement(array, 0, array.length);
	}
	
	public static <T extends Comparable<T>> T maxElement(T[] array, int first, int last) {
		if (first == last) {
			return null;
		}
		T result = array[0];
		for (int i = first; i < last; ++i) {
			if (result.compareTo(array[i]) < 0) {
				result = array[i];
			}
		}
		return result;
	}
	
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public static int lowerBoundIndex(Comparable[] array, int first, int last, Comparable value) {
		int count = last-first;
		while (count>0) { 
			int step = count / 2;
			int index = first+step;
			if (array[index].compareTo(value) < 0) {
				first = ++index;
				count -= step+1;
			} else {
				count = step;
			}
		}
		return first;
	}
	
	@SuppressWarnings("rawtypes")
	public static int lowerBoundIndex(Comparable[] array, Comparable value) {
		return lowerBoundIndex(array, 0, array.length, value);
	}
	
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static int upperBoundIndex(Comparable[] array, int first, int last, Comparable value) {
		int count = last-first;
		while (count>0) { 
			int step = count / 2;
			int index = first+step;
			if (value.compareTo(array[index]) >= 0) {
				first = ++index;
				count -= step+1;
			} else {
				count = step;
			}
		}
		return first;
	}
	
	@SuppressWarnings("rawtypes")
	public static int upperBoundIndex(Comparable[] array, Comparable value) {
		return upperBoundIndex(array, 0, array.length, value);
	}

	
}